From ded11c662cf1f9d5a3f11977d3ee9ae2d25a3386 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Tue, 15 Oct 2024 15:53:14 -0700 Subject: [PATCH 1/2] PR checks: fix formatting for nightly bundle URL and stable CLI version input --- .github/actions/prepare-test/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare-test/action.yml b/.github/actions/prepare-test/action.yml index 99e2bdf476..a06df3a4b0 100644 --- a/.github/actions/prepare-test/action.yml +++ b/.github/actions/prepare-test/action.yml @@ -2,7 +2,7 @@ name: "Prepare test" description: Performs some preparation to run tests inputs: version: - description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'." + description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z" required: true use-all-platform-bundle: description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL" @@ -56,7 +56,7 @@ runs: echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/$artifact_name" >> $GITHUB_OUTPUT elif [[ ${{ inputs.version }} == *"nightly"* ]]; then version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'` - echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version-manual/$artifact_name" >> $GITHUB_OUTPUT + echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT elif [[ ${{ inputs.version }} == *"stable"* ]]; then version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'` echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT From 2f0f924bb0e32bc85cfc13fdf9cbed5e657b3599 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Tue, 15 Oct 2024 15:54:30 -0700 Subject: [PATCH 2/2] Return early if version is `linked` or `default` --- .github/actions/prepare-test/action.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/actions/prepare-test/action.yml b/.github/actions/prepare-test/action.yml index a06df3a4b0..690f91770b 100644 --- a/.github/actions/prepare-test/action.yml +++ b/.github/actions/prepare-test/action.yml @@ -32,6 +32,14 @@ runs: run: | set -e # Fail this Action if `gh release list` fails. + if [[ ${{ inputs.version }} == "linked" ]]; then + echo "tools-url=linked" >> "$GITHUB_OUTPUT" + exit 0 + elif [[ ${{ inputs.version }} == "default" ]]; then + echo "tools-url=" >> "$GITHUB_OUTPUT" + exit 0 + fi + if [[ ${{ inputs.version }} == "nightly-latest" ]]; then extension="tar.zst" else @@ -60,10 +68,6 @@ runs: elif [[ ${{ inputs.version }} == *"stable"* ]]; then version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'` echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT - elif [[ ${{ inputs.version }} == "linked" ]]; then - echo "tools-url=linked" >> $GITHUB_OUTPUT - elif [[ ${{ inputs.version }} == "default" ]]; then - echo "tools-url=" >> $GITHUB_OUTPUT else echo "::error::Unrecognized version specified!" exit 1