Skip to content

Commit c9f92aa

Browse files
committed
backport checks changes to v2 branch
1 parent 03e7845 commit c9f92aa

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.github/workflows/pr-checks.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,41 @@ jobs:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 45
1717

18+
strategy:
19+
matrix:
20+
node-types-version: [16.11, current] # we backport this matrix job in order to maintain the same check names
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 "[email protected]"
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
52+
if: matrix.node-types-version != 'current' # we do not need to test the newer node on the v2 branch
2653
run: .github/workflows/script/check-js.sh
2754

2855
check-node-modules:

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ Since the `codeql-action` runs most of its testing through individual Actions wo
7676

7777
1. By default, this script retrieves the checks from the latest SHA on `main`, so make sure that your `main` branch is up to date.
7878
2. Run the script. If there's a reason to, you can pass in a different SHA as a CLI argument.
79-
3. After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v1`, and `v2` have been updated.
79+
3. After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v2`, and `v3` have been updated.
80+
81+
Note that any updates to checks need to be backported to the `releases/v2` branch, in order to maintain the same set of names for required checks.
8082

8183
## Deprecating a CodeQL version (write access required)
8284

@@ -111,7 +113,7 @@ To deprecate an older version of the Action:
111113
- Add a changelog note announcing the deprecation.
112114
- Implement an Actions warning for customers using the deprecated version.
113115
1. Wait for the deprecation period to pass.
114-
1. Upgrade the Actions warning for customers using the deprecated version to a non-fatal error, and mention that this version of the Action is no longer supported.
116+
1. Upgrade the Actions warning for customers using the deprecated version to a non-fatal error, and mention that this version of the Action is no longer supported.
115117
1. Make a PR to bump the `OLDEST_SUPPORTED_MAJOR_VERSION` in [release-branches.py](.github/actions/release-branches/release-branches.py). Once this PR is merged, the release process will no longer backport changes to the deprecated release version.
116118

117119
## Resources

0 commit comments

Comments
 (0)