From d70e2d97dea906a5b32eb540af35c039ea863f82 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Wed, 5 Jul 2023 13:11:08 -0400 Subject: [PATCH] chore: use correct prettier version in ci (#8321) Install prettier in package.json + yarn.lock. Global install was using incorrect version --- .github/workflows/ci.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4cf9e83af6..93aa714793 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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