Skip to content

Commit 5b52b36

Browse files
committed
reintroduce PR check that confirm action can be still be compiled on node16
1 parent 5b19bef commit 5b52b36

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/pr-checks.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy