diff --git a/.github/actions/prepare-test/action.yml b/.github/actions/prepare-test/action.yml index f93d102116..a6134cc706 100644 --- a/.github/actions/prepare-test/action.yml +++ b/.github/actions/prepare-test/action.yml @@ -23,15 +23,27 @@ runs: shell: bash run: | set -e # Fail this Action if `gh release list` fails. + + if [[ "$RUNNER_OS" == "Linux" ]]; then + artifact_name="codeql-bundle-linux64.tar.gz" + elif [[ "$RUNNER_OS" == "macOS" ]]; then + artifact_name="codeql-bundle-osx64.tar.gz" + elif [[ "$RUNNER_OS" == "Windows" ]]; then + artifact_name="codeql-bundle-win64.tar.gz" + else + echo "::error::Unrecognized OS $RUNNER_OS" + exit 1 + fi + 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 + tag=`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/$tag/$artifact_name" >> $GITHUB_OUTPUT elif [[ ${{ inputs.version }} == *"nightly"* ]]; then - export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'` - echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/codeql-bundle-$VERSION-manual/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT + 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 elif [[ ${{ inputs.version }} == *"stable"* ]]; then - export VERSION=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'` - echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$VERSION/codeql-bundle.tar.gz" >> $GITHUB_OUTPUT + 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 }} == "latest" ]]; then echo "tools-url=latest" >> $GITHUB_OUTPUT elif [[ ${{ inputs.version }} == "cached" ]]; then