Skip to content

Commit

Permalink
Fix prettify script & Github flow to use prettier from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Huulivoide committed Sep 9, 2024
1 parent de1a122 commit 0f06ef7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/check-prettify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Prettify sources
run: ./scripts/prettify.sh
- uses: actions/setup-node@v4
with:
node-version: '18.19.0'
cache: 'yarn'
cache-dependency-path: test/hasura/yarn.lock

- name: Verify that prettify command made no changes
run: '[ -z "$(git status --porcelain)" ]'
- name: Install node_modules
run: cd test/hasura && yarn install --frozen-lockfile

- name: Verify that prettier has been run
run: cd test/hasura && yarn prettier:check
6 changes: 5 additions & 1 deletion scripts/prettify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

set -eu

npx [email protected] --write .
# allow running from any working directory
WD=$(dirname "$0")
cd "${WD}/../test/hasura"

yarn prettier

0 comments on commit 0f06ef7

Please sign in to comment.