Skip to content

Commit

Permalink
[CI] Ensure specified version of Prettier is run in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Dec 13, 2024
1 parent 81c8e86 commit f7ff285
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- name: Create NPM cache-hash input file
run: |
mkdir -p tmp
jq '{devDependencies, dependencies, engines, gitHubActionCacheKey}' package.json > tmp/package-ci.json
jq '{devDependencies, engines, gitHubActionCacheKey}' package.json > tmp/package-ci.json
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: tmp/package-ci.json

- name: Check file format
run: npm run check:format --ignore-scripts
- run: npm install prettier@$(npm pkg get devDependencies.prettier | tr -d '^\"') --no-save
- run: npm run check:format
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"scripts": {
"__check:links": "make --keep-going check-links",
"_build": "npm run _hugo -- -e dev --buildDrafts --baseURL \"${DEPLOY_PRIME_URL:-http://localhost}\"",
"_check:format:any": "npx prettier --check --ignore-path ''",
"__check:format": "npx prettier@$(npm pkg get devDependencies.prettier | tr -d '^\"')",
"_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",
"_check:format": "npx prettier --check .",
"_check:format": "npm run __check:format -- --check .",
"_check:links--md": "npx markdown-link-check --config .markdown-link-check.json *.md",
"_check:links--warn": "npm run _check:links || (echo; echo 'WARNING: see link-checker output for issues.'; echo)",
"_check:links:internal": "npm run __check:links",
Expand Down

0 comments on commit f7ff285

Please sign in to comment.