@@ -26,19 +26,23 @@ jobs:
26
26
- name : Checkout
27
27
uses : actions/checkout@v4
28
28
29
+ - name : Install
30
+ shell : bash
31
+ run : npm install
32
+
29
33
- name : Lint
30
34
id : lint
31
35
run : npm run-script lint-ci
32
36
33
37
- name : Upload sarif
34
38
uses : github/codeql-action/upload-sarif@v3
35
39
# 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/') }}
37
41
with :
38
42
sarif_file : eslint.sarif
39
43
category : eslint
40
44
41
- - name : Update version of @types/node
45
+ - name : Override version of @types/node
42
46
if : matrix.node-types-version != 'current'
43
47
env :
44
48
NODE_TYPES_VERSION : ${{ matrix.node-types-version }}
52
56
# `npm install` on Linux.
53
57
npm install
54
58
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
+
55
78
if [ ! -z "$(git status --porcelain)" ]; then
56
79
git config --global user.email "github-actions@github.com"
57
80
git config --global user.name "github-actions[bot]"
@@ -112,6 +135,9 @@ jobs:
112
135
113
136
steps :
114
137
- uses : actions/checkout@v4
138
+ - name : Build
139
+ run : |
140
+ npm run build
115
141
- name : npm test
116
142
run : |
117
143
# Run any commands referenced in package.json using Bash, otherwise
0 commit comments