diff --git a/.github/workflows/check-prettify.yml b/.github/workflows/check-prettify.yml index 247ab614..ffe2fde0 100644 --- a/.github/workflows/check-prettify.yml +++ b/.github/workflows/check-prettify.yml @@ -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 diff --git a/scripts/prettify.sh b/scripts/prettify.sh index 01c664ee..56f8c6ea 100755 --- a/scripts/prettify.sh +++ b/scripts/prettify.sh @@ -2,4 +2,8 @@ set -eu -npx prettier@2.8.3 --write . +# allow running from any working directory +WD=$(dirname "$0") +cd "${WD}/../test/hasura" + +yarn prettier