File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,39 @@ jobs:
1515 runs-on : ubuntu-latest
1616 timeout-minutes : 45
1717
18+ strategy :
19+ matrix :
20+ node-types-version : [12.16, current]
21+
1822 steps :
1923 - name : Checkout
2024 uses : actions/checkout@v4
2125
2226 - name : Lint
2327 run : npm run-script lint
2428
29+ - name : Update version of @types/node
30+ if : matrix.node-types-version != 'current'
31+ env :
32+ NODE_TYPES_VERSION : ${{ matrix.node-types-version }}
33+ run : |
34+ # Export `NODE_TYPES_VERSION` so it's available to jq
35+ export NODE_TYPES_VERSION="${NODE_TYPES_VERSION}"
36+ contents=$(jq '.devDependencies."@types/node" = env.NODE_TYPES_VERSION' package.json)
37+ echo "${contents}" > package.json
38+ # Usually we run `npm install` on macOS to ensure that we pick up macOS-only dependencies.
39+ # However we're not checking in the updated lockfile here, so it's fine to run
40+ # `npm install` on Linux.
41+ npm install
42+
43+ if [ ! -z "$(git status --porcelain)" ]; then
44+ git config --global user.email "github-actions@github.com"
45+ git config --global user.name "github-actions[bot]"
46+ # The period in `git add --all .` ensures that we stage deleted files too.
47+ git add --all .
48+ git commit -m "Use @types/node=${NODE_TYPES_VERSION}"
49+ fi
50+
2551 - name : Check generated JS
2652 run : .github/workflows/script/check-js.sh
2753
You can’t perform that action at this time.
0 commit comments