Skip to content

Commit

Permalink
Merge pull request #1506 from github/henrymercer/prepare-test-fail-early
Browse files Browse the repository at this point in the history
Fail `prepare-test` early when `gh release list` fails
  • Loading branch information
henrymercer authored Jan 23, 2023
2 parents 66ed6f4 + 90bbfad commit 14c4412
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/prepare-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: "Prepare test"
description: Performs some preparation to run tests
inputs:
version:
description: "The version of the CodeQL CLI to use. Can be 'latest', 'cached', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
required: true
outputs:
tools-url:
description: "The value that should be passed as the 'tools' input of the 'init' step."
value: ${{ steps.get-url.outputs.tools-url }}
runs:
using: composite
Expand All @@ -20,6 +22,7 @@ runs:
name: Determine URL
shell: bash
run: |
set -e # Fail this Action if `gh release list` fails.
if [[ ${{ inputs.version }} == "nightly-latest" ]]; then
export LATEST=`gh release list --repo dsp-testing/codeql-cli-nightlies -L 1 | cut -f 3`
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT
Expand All @@ -34,5 +37,6 @@ runs:
elif [[ ${{ inputs.version }} == "cached" ]]; then
echo "tools-url=" >> $GITHUB_OUTPUT
else
echo "::error Unrecognized version specified!"
echo "::error::Unrecognized version specified!"
exit 1
fi

0 comments on commit 14c4412

Please sign in to comment.