Skip to content

Commit ad94f2f

Browse files
authored
Merge pull request #2548 from github/angelapwen/fix-prepare-test
PR checks: small fixups to `prepare-action`
2 parents 5636274 + 2f0f924 commit ad94f2f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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

+10-6
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-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
5+
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', '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"
@@ -32,6 +32,14 @@ runs:
3232
run: |
3333
set -e # Fail this Action if `gh release list` fails.
3434
35+
if [[ ${{ inputs.version }} == "linked" ]]; then
36+
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
37+
exit 0
38+
elif [[ ${{ inputs.version }} == "default" ]]; then
39+
echo "tools-url=" >> "$GITHUB_OUTPUT"
40+
exit 0
41+
fi
42+
3543
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
3644
extension="tar.zst"
3745
else
@@ -56,14 +64,10 @@ runs:
5664
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/$artifact_name" >> $GITHUB_OUTPUT
5765
elif [[ ${{ inputs.version }} == *"nightly"* ]]; then
5866
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
59-
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version-manual/$artifact_name" >> $GITHUB_OUTPUT
67+
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
6068
elif [[ ${{ inputs.version }} == *"stable"* ]]; then
6169
version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'`
6270
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
63-
elif [[ ${{ inputs.version }} == "linked" ]]; then
64-
echo "tools-url=linked" >> $GITHUB_OUTPUT
65-
elif [[ ${{ inputs.version }} == "default" ]]; then
66-
echo "tools-url=" >> $GITHUB_OUTPUT
6771
else
6872
echo "::error::Unrecognized version specified!"
6973
exit 1

0 commit comments

Comments
 (0)