Skip to content

Commit 2b07444

Browse files
authored
Merge pull request #3130 from github/henrymercer/request-nightly
Support requesting latest nightly with `tools: nightly`
2 parents 6117099 + 5ab5aef commit 2b07444

File tree

11 files changed

+267
-32
lines changed

11 files changed

+267
-32
lines changed

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

Lines changed: 10 additions & 16 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', '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"
@@ -35,37 +35,31 @@ runs:
3535
run: |
3636
set -e # Fail this Action if `gh release list` fails.
3737
38-
if [[ "$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
3942
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
4043
exit 0
4144
elif [[ "$VERSION" == "default" ]]; then
4245
echo "tools-url=" >> "$GITHUB_OUTPUT"
4346
exit 0
4447
fi
4548
46-
if [[ "$VERSION" == "nightly-latest" && "$RUNNER_OS" != "Windows" ]]; then
47-
extension="tar.zst"
48-
else
49-
extension="tar.gz"
50-
fi
51-
5249
if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then
53-
artifact_name="codeql-bundle.$extension"
50+
artifact_name="codeql-bundle.tar.gz"
5451
elif [[ "$RUNNER_OS" == "Linux" ]]; then
55-
artifact_name="codeql-bundle-linux64.$extension"
52+
artifact_name="codeql-bundle-linux64.tar.gz"
5653
elif [[ "$RUNNER_OS" == "macOS" ]]; then
57-
artifact_name="codeql-bundle-osx64.$extension"
54+
artifact_name="codeql-bundle-osx64.tar.gz"
5855
elif [[ "$RUNNER_OS" == "Windows" ]]; then
59-
artifact_name="codeql-bundle-win64.$extension"
56+
artifact_name="codeql-bundle-win64.tar.gz"
6057
else
6158
echo "::error::Unrecognized OS $RUNNER_OS"
6259
exit 1
6360
fi
6461
65-
if [[ "$VERSION" == "nightly-latest" ]]; then
66-
tag=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
67-
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/$artifact_name" >> $GITHUB_OUTPUT
68-
elif [[ "$VERSION" == *"nightly"* ]]; then
62+
if [[ "$VERSION" == *"nightly"* ]]; then
6963
version=`echo "$VERSION" | sed -e 's/^.*\-//'`
7064
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
7165
elif [[ "$VERSION" == *"stable"* ]]; then

.github/workflows/__test-local-codeql.yml

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
66

77
- We have improved the CodeQL Action's ability to validate that the workflow it is used in does not use different versions of the CodeQL Action for different workflow steps. Mixing different versions of the CodeQL Action in the same workflow is unsupported and can lead to unpredictable results. A warning will now be emitted from the `codeql-action/init` step if different versions of the CodeQL Action are detected in the workflow file. Additionally, an error will now be thrown by the other CodeQL Action steps if they load a configuration file that was generated by a different version of the `codeql-action/init` step. [#3099](https://github.com/github/codeql-action/pull/3099) and [#3100](https://github.com/github/codeql-action/pull/3100)
88
- We added support for reducing the size of dependency caches for Java analyses, which will reduce cache usage and speed up workflows. This will be enabled automatically at a later time. [#3107](https://github.com/github/codeql-action/pull/3107)
9+
- You can now run the latest CodeQL nightly bundle by passing `tools: nightly` to the `init` action. In general, the nightly bundle is unstable and we only recommend running it when directed by GitHub staff. [#3130](https://github.com/github/codeql-action/pull/3130)
910

1011
## 3.30.3 - 10 Sep 2025
1112

init/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ inputs:
1212
- The URL of a CodeQL Bundle tarball GitHub release asset, or
1313
- A special value `linked` which uses the version of the CodeQL tools
1414
that the Action has been bundled with.
15+
- A special value `nightly` which uses the latest nightly version of the
16+
CodeQL tools. Note that this is unstable and not recommended for
17+
production use.
1518
1619
If not specified, the Action will check in several places until it finds
1720
the CodeQL tools.

lib/analyze-action.js

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)