From c7c356909d69399cb010eddaf2d2c774baffb7a3 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Fri, 13 Dec 2024 05:03:39 -0500 Subject: [PATCH] Use PRETTIER_AT_VERS --- .github/workflows/check-format.yml | 8 +++++++- package.json | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index b9976ac84fd0..6a19bc01f4e1 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -29,5 +29,11 @@ jobs: cache: npm cache-dependency-path: tmp/package-ci.json - - run: npm install prettier@$(npm pkg get devDependencies.prettier | tr -d '^\"') --no-save + - name: Install package(s) + run: | + PRETTIER_AT_VERS=@$(npm pkg get devDependencies.prettier | tr -d '^"') + echo "PRETTIER_AT_VERS=$PRETTIER_AT_VERS" >> $GITHUB_ENV + npm install prettier$PRETTIER_AT_VERS --no-save + npx prettier --version + - run: npm run check:format diff --git a/package.json b/package.json index 44c7df5f1415..41d1c2c58c83 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "__check:links": "make --keep-going check-links", "_build": "npm run _hugo -- -e dev --buildDrafts --baseURL \"${DEPLOY_PRIME_URL:-http://localhost}\"", - "__check:format": "npx prettier@$(npm pkg get devDependencies.prettier | tr -d '^\"')", + "__check:format": "npx prettier${PRETTIER_AT_VERS}", "_check:format:any": "npm run __check:format -- --check --ignore-path ''", "_check:format:ja+zh": "npm run _check:format:nowrap -- content/ja content/zh", "_check:format:nowrap": "npm run _check:format:any -- --prose-wrap preserve", @@ -121,7 +121,7 @@ "markdown-link-check": "^3.13.6", "markdownlint": "^0.36.1", "postcss-cli": "^11.0.0", - "prettier": "^3.4.2", + "prettier": "3.4.2", "require-dir": "^1.2.0", "textlint": "^14.4.0", "textlint-filter-rule-allowlist": "^4.0.0",