Skip to content

Commit

Permalink
Merge pull request #2006 from github/nickfyson/node-20
Browse files Browse the repository at this point in the history
change to node20 for all actions
nickfyson authored Dec 13, 2023
2 parents b995212 + c757f9f commit 64e61ba
Showing 166 changed files with 60,183 additions and 5,370 deletions.
2 changes: 1 addition & 1 deletion .github/actions/check-sarif/action.yml
Original file line number Diff line number Diff line change
@@ -16,5 +16,5 @@ inputs:
Comma separated list of query ids that should NOT be included in this SARIF file.
runs:
using: node16
using: node20
main: index.js
5 changes: 4 additions & 1 deletion .github/update-release-branch.py
Original file line number Diff line number Diff line change
@@ -255,10 +255,13 @@ def main():
print(f'No commits to merge from {source_branch} to {target_branch}.')
return

# define distinct prefix in order to support specific pr checks on backports
branch_prefix = 'update' if is_primary_release else 'backport'

# The branch name is based off of the name of branch being merged into
# and the SHA of the branch being merged from. Thus if the branch already
# exists we can assume we don't need to recreate it.
new_branch_name = f'update-v{version}-{source_branch_short_sha}'
new_branch_name = f'{branch_prefix}-v{version}-{source_branch_short_sha}'
print(f'Branch name is {new_branch_name}.')

# Check if the branch already exists. If so we can abort as this script
67 changes: 67 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -15,13 +15,39 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 45

strategy:
matrix:
node-types-version: [16.11, current] # run tests on 16.11 while CodeQL Action v2 is still supported

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Lint
run: npm run-script lint

- name: Update version of @types/node
if: matrix.node-types-version != 'current'
env:
NODE_TYPES_VERSION: ${{ matrix.node-types-version }}
run: |
# Export `NODE_TYPES_VERSION` so it's available to jq
export NODE_TYPES_VERSION="${NODE_TYPES_VERSION}"
contents=$(jq '.devDependencies."@types/node" = env.NODE_TYPES_VERSION' package.json)
echo "${contents}" > package.json
# Usually we run `npm install` on macOS to ensure that we pick up macOS-only dependencies.
# However we're not checking in the updated lockfile here, so it's fine to run
# `npm install` on Linux.
npm install
if [ ! -z "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "github-actions[bot]"
# The period in `git add --all .` ensures that we stage deleted files too.
git add --all .
git commit -m "Use @types/node=${NODE_TYPES_VERSION}"
fi
- name: Check generated JS
run: .github/workflows/script/check-js.sh

@@ -88,3 +114,44 @@ jobs:
# we won't be able to find them on Windows.
npm config set script-shell bash
npm test
check-node-version:
if: ${{ github.event.pull_request }}
name: Check Action Node versions
runs-on: ubuntu-latest
timeout-minutes: 45
env:
BASE_REF: ${{ github.base_ref }}

steps:
- uses: actions/checkout@v4
- id: head-version
name: Verify all Actions use the same Node version
run: |
NODE_VERSION=$(find . -name "action.yml" -exec yq -e '.runs.using' {} \; | grep node | sort | uniq)
echo "NODE_VERSION: ${NODE_VERSION}"
if [[ $(echo "$NODE_VERSION" | wc -l) -gt 1 ]]; then
echo "::error::More than one node version used in 'action.yml' files."
exit 1
fi
echo "node_version=${NODE_VERSION}" >> $GITHUB_OUTPUT
- id: checkout-base
name: 'Backport: Check out base ref'
if: ${{ startsWith(github.head_ref, 'backport-') }}
uses: actions/checkout@v4
with:
ref: ${{ env.BASE_REF }}

- name: 'Backport: Verify Node versions unchanged'
if: steps.checkout-base.outcome == 'success'
env:
HEAD_VERSION: ${{ steps.head-version.outputs.node_version }}
run: |
BASE_VERSION=$(find . -name "action.yml" -exec yq -e '.runs.using' {} \; | grep node | sort | uniq)
echo "HEAD_VERSION: ${HEAD_VERSION}"
echo "BASE_VERSION: ${BASE_VERSION}"
if [[ "$BASE_VERSION" != "$HEAD_VERSION" ]]; then
echo "::error::Cannot change the Node version of an Action in a backport PR."
exit 1
fi
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

## [UNRELEASED]

No user facing changes.
- [v3+ only] The CodeQL Action now runs on Node.js v20. [#2006](https://github.com/github/codeql-action/pull/2006)

## 2.22.10 - 12 Dec 2023

2 changes: 1 addition & 1 deletion analyze/action.yml
Original file line number Diff line number Diff line change
@@ -84,6 +84,6 @@ outputs:
sarif-id:
description: The ID of the uploaded SARIF file.
runs:
using: "node16"
using: node20
main: "../lib/analyze-action.js"
post: "../lib/analyze-action-post.js"
2 changes: 1 addition & 1 deletion autobuild/action.yml
Original file line number Diff line number Diff line change
@@ -13,5 +13,5 @@ inputs:
$GITHUB_WORKSPACE as its working directory.
required: false
runs:
using: 'node16'
using: node20
main: '../lib/autobuild-action.js'
2 changes: 1 addition & 1 deletion init/action.yml
Original file line number Diff line number Diff line change
@@ -109,6 +109,6 @@ outputs:
codeql-path:
description: The path of the CodeQL binary used for analysis
runs:
using: 'node16'
using: node20
main: '../lib/init-action.js'
post: '../lib/init-action-post.js'
6 changes: 3 additions & 3 deletions lib/autobuild.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions lib/init-action-post-helper.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 29 additions & 29 deletions lib/workflow.test.js
16 changes: 12 additions & 4 deletions node_modules/.package-lock.json
Empty file modified node_modules/@types/node/LICENSE
100755 → 100644
Empty file.
11 changes: 5 additions & 6 deletions node_modules/@types/node/README.md
100755 → 100644
282 changes: 183 additions & 99 deletions node_modules/@types/node/assert.d.ts
100755 → 100644

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions node_modules/@types/node/assert/strict.d.ts
100755 → 100644
128 changes: 85 additions & 43 deletions node_modules/@types/node/async_hooks.d.ts
100755 → 100644
486 changes: 353 additions & 133 deletions node_modules/@types/node/buffer.d.ts
100755 → 100644

Large diffs are not rendered by default.

530 changes: 352 additions & 178 deletions node_modules/@types/node/child_process.d.ts
100755 → 100644

Large diffs are not rendered by default.

252 changes: 135 additions & 117 deletions node_modules/@types/node/cluster.d.ts
100755 → 100644

Large diffs are not rendered by default.

41 changes: 22 additions & 19 deletions node_modules/@types/node/console.d.ts
100755 → 100644
23 changes: 12 additions & 11 deletions node_modules/@types/node/constants.d.ts
100755 → 100644
2,115 changes: 1,632 additions & 483 deletions node_modules/@types/node/crypto.d.ts
100755 → 100644

Large diffs are not rendered by default.

165 changes: 103 additions & 62 deletions node_modules/@types/node/dgram.d.ts
100755 → 100644
95 changes: 76 additions & 19 deletions node_modules/@types/node/diagnostics_channel.d.ts
100755 → 100644
329 changes: 242 additions & 87 deletions node_modules/@types/node/dns.d.ts
100755 → 100644

Large diffs are not rendered by default.

127 changes: 88 additions & 39 deletions node_modules/@types/node/dns/promises.d.ts
100755 → 100644
122 changes: 122 additions & 0 deletions node_modules/@types/node/dom-events.d.ts
19 changes: 10 additions & 9 deletions node_modules/@types/node/domain.d.ts
100755 → 100644
369 changes: 295 additions & 74 deletions node_modules/@types/node/events.d.ts
100755 → 100644

Large diffs are not rendered by default.

1,365 changes: 935 additions & 430 deletions node_modules/@types/node/fs.d.ts
100755 → 100644

Large diffs are not rendered by default.

417 changes: 279 additions & 138 deletions node_modules/@types/node/fs/promises.d.ts
100755 → 100644

Large diffs are not rendered by default.

157 changes: 127 additions & 30 deletions node_modules/@types/node/globals.d.ts
100755 → 100644
Empty file modified node_modules/@types/node/globals.global.d.ts
100755 → 100644
Empty file.
1,063 changes: 786 additions & 277 deletions node_modules/@types/node/http.d.ts
100755 → 100644

Large diffs are not rendered by default.

1,133 changes: 707 additions & 426 deletions node_modules/@types/node/http2.d.ts
100755 → 100644

Large diffs are not rendered by default.

423 changes: 291 additions & 132 deletions node_modules/@types/node/https.d.ts
100755 → 100644

Large diffs are not rendered by default.

50 changes: 4 additions & 46 deletions node_modules/@types/node/index.d.ts
100755 → 100644
40 changes: 21 additions & 19 deletions node_modules/@types/node/inspector.d.ts
100755 → 100644
Loading

0 comments on commit 64e61ba

Please sign in to comment.