-
Notifications
You must be signed in to change notification settings - Fork 375
change to node20 for all actions #2006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d651fbc
change to node20 for all actions
nickfyson f2d0c2e
upgrade node type definitions
nickfyson 5b19bef
change to node20 for all actions
nickfyson 5b52b36
reintroduce PR check that confirm action can be still be compiled on …
nickfyson cc4fead
update version in various hardcoded locations
nickfyson 3a9f6a8
update javascript files
nickfyson 303dec0
fix choice of older node version to test
nickfyson bf51594
Update checked-in dependencies
github-actions[bot] 95be4b2
add not about continuing testing on node 16
nickfyson 0bc194e
switch check sarif action to node20
nickfyson 1de8705
Merge branch 'main' into nickfyson/node-20
nickfyson b974542
Merge branch 'main' into nickfyson/node-20
nickfyson ea1e72c
Update .github/workflows/pr-checks.yml
nickfyson 6b5b958
remove dedundant single quotes from node version strings
nickfyson 7898bc2
add pr check for node version consistency
nickfyson c757f9f
Apply suggestions from code review
nickfyson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 node version consistency | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 45 | ||
env: | ||
BASE_REF: ${{ github.base_ref }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: head-version | ||
name: check HEAD node version | ||
nickfyson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 actions." | ||
nickfyson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exit 1 | ||
fi | ||
echo "node_version=${NODE_VERSION}" >> $GITHUB_OUTPUT | ||
|
||
- id: checkout-base | ||
name: check out base ref for backport check | ||
nickfyson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if: ${{ startsWith(github.head_ref, 'backport-') }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.BASE_REF }} | ||
|
||
- name: compare with node version on base ref for backport check | ||
nickfyson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 node version in a backport PR." | ||
nickfyson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exit 1 | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.