Skip to content

Commit d70e2d9

Browse files
authored
chore: use correct prettier version in ci (#8321)
Install prettier in package.json + yarn.lock. Global install was using incorrect version
1 parent 0f5a1ad commit d70e2d9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,16 @@ jobs:
203203
go-version: 1.20.5
204204

205205
- name: Install prettier
206-
run: npm install -g prettier
206+
# We only need prettier for fmt, so do not install all dependencies.
207+
# There is no way to install a single package with yarn, so we have to
208+
# make a new package.json with only prettier listed as a dependency.
209+
# Then running `yarn` will only install prettier.
210+
run: |
211+
cd site
212+
mv package.json package.json.bak
213+
jq '{dependencies: {prettier: .devDependencies.prettier}}' < package.json.bak > package.json
214+
yarn --frozen-lockfile
215+
mv package.json.bak package.json
207216
208217
- name: Install shfmt
209218
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0

0 commit comments

Comments
 (0)