Skip to content

Commit c9223eb

Browse files
authored
Merge branch 'main' into sam-robson/document-version-pinning-risk
2 parents f0767c4 + 710e294 commit c9223eb

File tree

23,315 files changed

+1568577
-4976981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

23,315 files changed

+1568577
-4976981
lines changed

.github/actions/check-codescanning-config/action.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ runs:
6161
- name: Check config
6262
working-directory: ${{ github.action_path }}
6363
shell: bash
64-
run: ts-node ./index.ts "${{ runner.temp }}/user-config.yaml" '${{ inputs.expected-config-file-contents }}'
65-
64+
env:
65+
EXPECTED_CONFIG_FILE_CONTENTS: '${{ inputs.expected-config-file-contents }}'
66+
run: ts-node ./index.ts "$RUNNER_TEMP/user-config.yaml" "$EXPECTED_CONFIG_FILE_CONTENTS"
6667
- name: Clean up
6768
shell: bash
6869
if: always()
6970
run: |
70-
rm -rf ${{ runner.temp }}/codescanning-config-cli-test
71-
rm -rf ${{ runner.temp }}/user-config.yaml
71+
rm -rf $RUNNER_TEMP/codescanning-config-cli-test
72+
rm -rf $RUNNER_TEMP/user-config.yaml

.github/actions/check-codescanning-config/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@ import * as assert from 'assert'
66

77
const actualConfig = loadActualConfig()
88

9+
function sortConfigArrays(config) {
10+
for (const key of Object.keys(config)) {
11+
const value = config[key];
12+
if (key === 'queries' && Array.isArray(value)) {
13+
config[key] = value.sort();
14+
}
15+
}
16+
return config;
17+
}
18+
919
const rawExpectedConfig = process.argv[3].trim()
1020
if (!rawExpectedConfig) {
11-
core.info('No expected configuration provided')
21+
core.setFailed('No expected configuration provided')
1222
} else {
1323
core.startGroup('Expected generated user config')
1424
core.info(yaml.dump(JSON.parse(rawExpectedConfig)))
@@ -18,8 +28,8 @@ if (!rawExpectedConfig) {
1828
const expectedConfig = rawExpectedConfig ? JSON.parse(rawExpectedConfig) : undefined;
1929

2030
assert.deepStrictEqual(
21-
actualConfig,
22-
expectedConfig,
31+
sortConfigArrays(actualConfig),
32+
sortConfigArrays(expectedConfig),
2333
'Expected configuration does not match actual configuration'
2434
);
2535

.github/actions/check-sarif/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ inputs:
1616
Comma separated list of query ids that should NOT be included in this SARIF file.
1717
1818
runs:
19-
using: node20
19+
using: node24
2020
main: index.js
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: "Prepare mergeback branch"
2+
description: Prepares a mergeback branch and opens a PR for it
3+
inputs:
4+
base:
5+
description: "The name of the base branch"
6+
required: true
7+
head:
8+
description: "The name of the head branch"
9+
required: true
10+
branch:
11+
description: "The name of the branch to create."
12+
required: true
13+
version:
14+
description: "The new version"
15+
required: true
16+
token:
17+
description: "The token to use"
18+
required: true
19+
dry-run:
20+
description: "Set to true to skip creating the PR. The branch will still be pushed."
21+
default: "false"
22+
runs:
23+
using: composite
24+
steps:
25+
- name: Create mergeback branch
26+
shell: bash
27+
env:
28+
VERSION: "${{ inputs.version }}"
29+
NEW_BRANCH: "${{ inputs.branch }}"
30+
run: |
31+
set -exu
32+
33+
# Ensure we are on the new branch
34+
git checkout "${NEW_BRANCH}"
35+
36+
# Update the version number ready for the next release
37+
npm version patch --no-git-tag-version
38+
39+
# Update the changelog, adding a new version heading directly above the most recent existing one
40+
awk '!f && /##/{print "'"## [UNRELEASED]\n\nNo user facing changes.\n"'"; f=1}1' CHANGELOG.md > temp && mv temp CHANGELOG.md
41+
git add .
42+
git commit -m "Update changelog and version after ${VERSION}"
43+
44+
git push origin "${NEW_BRANCH}"
45+
46+
- name: Create PR
47+
shell: bash
48+
if: inputs.dry-run != 'true'
49+
env:
50+
VERSION: "${{ inputs.version }}"
51+
BASE_BRANCH: "${{ inputs.base }}"
52+
HEAD_BRANCH: "${{ inputs.head }}"
53+
NEW_BRANCH: "${{ inputs.branch }}"
54+
GITHUB_TOKEN: "${{ inputs.token }}"
55+
run: |
56+
set -exu
57+
pr_title="Mergeback ${VERSION} ${HEAD_BRANCH} into ${BASE_BRANCH}"
58+
pr_body=$(cat << EOF
59+
This PR bumps the version number and updates the changelog after the ${VERSION} release.
60+
61+
Please do the following:
62+
63+
- [ ] Remove and re-add the "Rebuild" label to the PR to trigger just this workflow.
64+
- [ ] Wait for the "Rebuild" workflow to push a commit updating the distribution files.
65+
- [ ] Mark the PR as ready for review to trigger the full set of PR checks.
66+
- [ ] Approve and merge the PR. When merging the PR, make sure "Create a merge commit" is
67+
selected rather than "Squash and merge" or "Rebase and merge".
68+
EOF
69+
)
70+
71+
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
72+
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
73+
gh pr create \
74+
--head "${NEW_BRANCH}" \
75+
--base "${BASE_BRANCH}" \
76+
--title "${pr_title}" \
77+
--label "Rebuild" \
78+
--body "${pr_body}" \
79+
--assignee "${GITHUB_ACTOR}" \
80+
--draft

.github/actions/prepare-test/action.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Prepare test"
22
description: Performs some preparation to run tests
33
inputs:
44
version:
5-
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z"
5+
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'toolcache', 'nightly', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z"
66
required: true
77
use-all-platform-bundle:
88
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
@@ -29,44 +29,44 @@ runs:
2929
- id: get-url
3030
name: Determine URL
3131
shell: bash
32+
env:
33+
VERSION: ${{ inputs.version }}
34+
USE_ALL_PLATFORM_BUNDLE: ${{ inputs.use-all-platform-bundle }}
3235
run: |
3336
set -e # Fail this Action if `gh release list` fails.
3437
35-
if [[ ${{ inputs.version }} == "linked" ]]; then
38+
if [[ "$VERSION" == "nightly" || "$VERSION" == "nightly-latest" ]]; then
39+
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
40+
exit 0
41+
elif [[ "$VERSION" == "linked" ]]; then
3642
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
3743
exit 0
38-
elif [[ ${{ inputs.version }} == "default" ]]; then
44+
elif [[ "$VERSION" == "toolcache" ]]; then
45+
echo "tools-url=toolcache" >> "$GITHUB_OUTPUT"
46+
exit 0
47+
elif [[ "$VERSION" == "default" ]]; then
3948
echo "tools-url=" >> "$GITHUB_OUTPUT"
4049
exit 0
4150
fi
4251
43-
if [[ ${{ inputs.version }} == "nightly-latest" && "$RUNNER_OS" != "Windows" ]]; then
44-
extension="tar.zst"
45-
else
46-
extension="tar.gz"
47-
fi
48-
49-
if [[ ${{ inputs.use-all-platform-bundle }} == "true" ]]; then
50-
artifact_name="codeql-bundle.$extension"
52+
if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then
53+
artifact_name="codeql-bundle.tar.gz"
5154
elif [[ "$RUNNER_OS" == "Linux" ]]; then
52-
artifact_name="codeql-bundle-linux64.$extension"
55+
artifact_name="codeql-bundle-linux64.tar.gz"
5356
elif [[ "$RUNNER_OS" == "macOS" ]]; then
54-
artifact_name="codeql-bundle-osx64.$extension"
57+
artifact_name="codeql-bundle-osx64.tar.gz"
5558
elif [[ "$RUNNER_OS" == "Windows" ]]; then
56-
artifact_name="codeql-bundle-win64.$extension"
59+
artifact_name="codeql-bundle-win64.tar.gz"
5760
else
5861
echo "::error::Unrecognized OS $RUNNER_OS"
5962
exit 1
6063
fi
6164
62-
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
63-
tag=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
64-
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/$artifact_name" >> $GITHUB_OUTPUT
65-
elif [[ ${{ inputs.version }} == *"nightly"* ]]; then
66-
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
65+
if [[ "$VERSION" == *"nightly"* ]]; then
66+
version=`echo "$VERSION" | sed -e 's/^.*\-//'`
6767
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
68-
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
69-
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
68+
elif [[ "$VERSION" == *"stable"* ]]; then
69+
version=`echo "$VERSION" | sed -e 's/^.*\-//'`
7070
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
7171
else
7272
echo "::error::Unrecognized version specified!"

.github/actions/release-branches/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ runs:
1818
using: "composite"
1919
steps:
2020
- id: branches
21+
env:
22+
MAJOR_VERSION: ${{ inputs.major_version }}
23+
LATEST_TAG: ${{ inputs.latest_tag }}
2124
run: |
2225
python ${{ github.action_path }}/release-branches.py \
23-
--major-version ${{ inputs.major_version }} \
24-
--latest-tag ${{ inputs.latest_tag }}
26+
--major-version "$MAJOR_VERSION" \
27+
--latest-tag "$LATEST_TAG"
2528
shell: bash

.github/actions/release-initialise/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ runs:
1616
shell: bash
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@v5
19+
uses: actions/setup-python@v6
2020
with:
21-
python-version: 3.12
21+
python-version: '3.12'
2222

2323
- name: Install dependencies
2424
run: |

.github/actions/setup-swift/action.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: Verify that the best-effort debug artifact scan completed
2+
description: Verifies that the best-effort debug artifact scan completed successfully during tests
3+
runs:
4+
using: node24
5+
main: index.js
6+
post: post.js
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// The main step is a no-op, since we can only verify artifact scan completion in the post step.
2+
console.log("Will verify artifact scan completion in the post step.");

0 commit comments

Comments
 (0)