chore: use correct prettier version in ci (#8321)

Install prettier in package.json + yarn.lock. Global install was using incorrect version
This commit is contained in:
Steven Masley
2023-07-05 13:11:08 -04:00
committed by GitHub
parent 0f5a1ad480
commit d70e2d97de
+10 -1
View File
@@ -203,7 +203,16 @@ jobs:
go-version: 1.20.5
- name: Install prettier
run: npm install -g prettier
# We only need prettier for fmt, so do not install all dependencies.
# There is no way to install a single package with yarn, so we have to
# make a new package.json with only prettier listed as a dependency.
# Then running `yarn` will only install prettier.
run: |
cd site
mv package.json package.json.bak
jq '{dependencies: {prettier: .devDependencies.prettier}}' < package.json.bak > package.json
yarn --frozen-lockfile
mv package.json.bak package.json
- name: Install shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0