Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail prepare-test early when gh release list fails #1506

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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