44 push :
55 branches : [main]
66
7+ permissions :
8+ id-token : write # Required for OIDC https://docs.npmjs.com/trusted-publishers
9+
710jobs :
811 dry-run :
912 runs-on : ubuntu-latest
@@ -15,33 +18,17 @@ jobs:
1518 node-version : " 22"
1619 - run : npm ci
1720 - name : Check formatting
18- run : |
19- set -eo pipefail
20- files_to_format=$(npm run format:check --silent || true)
21- if [ -n "$files_to_format" ]; then
22- echo "The following files are not formatted correctly:"
23- echo "$files_to_format"
24- {
25- echo "formatted_files<<EOF"
26- echo "$files_to_format"
27- echo "EOF"
28- echo "formatting_needed=true"
29- } >> $GITHUB_OUTPUT
30- exit 1
31- else
32- echo "All files are formatted correctly."
33- echo "formatting_needed=false" >> $GITHUB_OUTPUT
34- fi
35- - run : npm test
36- - uses : JS-DevTools/npm-publish@v3
21+ run : make format-check
22+ # Ensure npm 11.5.1 or later is installed
23+ - name : Update npm
24+ run : npm install -g npm@latest
25+ - name : Dry run
3726 if : github.actor != 'dependabot[bot]'
38- with :
39- token : ${{ secrets.NPM_TOKEN }}
40- dry-run : true
27+ run : npm publish --dry-run
4128
4229 publish :
4330 needs : dry-run
44- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
31+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]'
4532 runs-on : ubuntu-latest
4633 timeout-minutes : ${{ fromJSON(vars.DEFAULT_JOB_TIMEOUT_MINUTES) }}
4734 steps :
5037 with :
5138 node-version : " 22"
5239 - run : npm ci
53- - run : npm test
54- - uses : JS-DevTools/ npm-publish@v3
55- if : github.actor != 'dependabot[bot]'
56- with :
57- token : ${{ secrets.NPM_TOKEN }}
40+ # Ensure npm 11.5.1 or later is installed
41+ - name : Update npm
42+ run : npm install -g npm@latest
43+ - name : Publish
44+ run : npm publish
0 commit comments