Skip to content

Commit 14c4412

Browse files
authored
Merge pull request #1506 from github/henrymercer/prepare-test-fail-early
Fail `prepare-test` early when `gh release list` fails
2 parents 66ed6f4 + 90bbfad commit 14c4412

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/prepare-test/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ 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 'latest', 'cached', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
56
required: true
67
outputs:
78
tools-url:
9+
description: "The value that should be passed as the 'tools' input of the 'init' step."
810
value: ${{ steps.get-url.outputs.tools-url }}
911
runs:
1012
using: composite
@@ -20,6 +22,7 @@ runs:
2022
name: Determine URL
2123
shell: bash
2224
run: |
25+
set -e # Fail this Action if `gh release list` fails.
2326
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
2427
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
2528
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
@@ -34,5 +37,6 @@ runs:
3437
elif [[ ${{ inputs.version }} == "cached" ]]; then
3538
echo "tools-url=" >> $GITHUB_OUTPUT
3639
else
37-
echo "::error Unrecognized version specified!"
40+
echo "::error::Unrecognized version specified!"
41+
exit 1
3842
fi

0 commit comments

Comments
 (0)