@@ -26,19 +26,23 @@ jobs:
2626 - name : Checkout
2727 uses : actions/checkout@v4
2828
29+ - name : Install
30+ shell : bash
31+ run : npm install
32+
2933 - name : Lint
3034 id : lint
3135 run : npm run-script lint-ci
3236
3337 - name : Upload sarif
3438 uses : github/codeql-action/upload-sarif@v3
3539 # Only upload SARIF for the latest version of Node.js
36- if : " !cancelled() && matrix.node-types-version == 'current' && !startsWith(github.head_ref, 'dependabot/')"
40+ if : ${{ !cancelled() && matrix.node-types-version == 'current' && !startsWith(github.head_ref, 'dependabot/') }}
3741 with :
3842 sarif_file : eslint.sarif
3943 category : eslint
4044
41- - name : Update version of @types/node
45+ - name : Override version of @types/node
4246 if : matrix.node-types-version != 'current'
4347 env :
4448 NODE_TYPES_VERSION : ${{ matrix.node-types-version }}
5256 # `npm install` on Linux.
5357 npm install
5458
59+ # esbuild embeds package.json version details into these files.
60+ # Since the jq step has actively changed package.json, we know that if these files
61+ # are successfully rebuilt (without the changes below), they would be dirty.
62+ #
63+ # In order to allow check-js.sh to verify that it can build them at all, we ignore them,
64+ # delete them, and commit those changes. Thus, when it runs, it will be able to try to
65+ # build them, and as long at they build, it will be happy. If it can't build them, it can
66+ # complain, although that error won't make much sense, because you shouldn't update them
67+ # using the wrong node types version information.
68+ (
69+ echo '*/*-action.js';
70+ echo '*/*-action-post.js'
71+ ) >> .gitignore
72+ for action in $(
73+ find * -mindepth 1 -maxdepth 1 -type f -name action.yml
74+ ); do
75+ git rm -f "$(dirname "$action")"/*-action*.js
76+ done
77+
5578 if [ ! -z "$(git status --porcelain)" ]; then
5679 git config --global user.email "github-actions@github.com"
5780 git config --global user.name "github-actions[bot]"
6386 - name : Check generated JS
6487 run : .github/workflows/script/check-js.sh
6588
66- check-node-modules :
67- if : github.event_name != 'push' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases/v')
68- name : Check modules up to date
69- runs-on : macos-latest
70- timeout-minutes : 45
71-
72- steps :
73- - uses : actions/checkout@v4
74- - name : Check node modules up to date
75- run : .github/workflows/script/check-node-modules.sh
76-
7789 check-file-contents :
7890 if : github.event_name != 'push' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases/v')
7991 name : Check file contents
@@ -102,7 +114,7 @@ jobs:
102114 npm-test :
103115 if : github.event_name != 'push' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/releases/v')
104116 name : Unit Test
105- needs : [ check-js, check-node-modules]
117+ needs : check-js
106118 strategy :
107119 fail-fast : false
108120 matrix :
@@ -112,6 +124,9 @@ jobs:
112124
113125 steps :
114126 - uses : actions/checkout@v4
127+ - name : Build
128+ run : |
129+ npm run build
115130 - name : npm test
116131 run : |
117132 # Run any commands referenced in package.json using Bash, otherwise
0 commit comments