From 9a45cd8c5025281c30bbb652197ace083c291e49 Mon Sep 17 00:00:00 2001 From: nickfyson Date: Wed, 9 Apr 2025 14:13:35 +0100 Subject: [PATCH] move use of input variables into env vars --- .github/actions/prepare-test/action.yml | 21 ++++++++++++--------- .github/actions/release-branches/action.yml | 7 +++++-- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/actions/prepare-test/action.yml b/.github/actions/prepare-test/action.yml index 2f814d3dac..8e8227c3ac 100644 --- a/.github/actions/prepare-test/action.yml +++ b/.github/actions/prepare-test/action.yml @@ -29,24 +29,27 @@ runs: - id: get-url name: Determine URL shell: bash + env: + VERSION: ${{ inputs.version }} + USE_ALL_PLATFORM_BUNDLE: ${{ inputs.use-all-platform-bundle }} run: | set -e # Fail this Action if `gh release list` fails. - if [[ ${{ inputs.version }} == "linked" ]]; then + if [[ "$VERSION" == "linked" ]]; then echo "tools-url=linked" >> "$GITHUB_OUTPUT" exit 0 - elif [[ ${{ inputs.version }} == "default" ]]; then + elif [[ "$VERSION" == "default" ]]; then echo "tools-url=" >> "$GITHUB_OUTPUT" exit 0 fi - if [[ ${{ inputs.version }} == "nightly-latest" && "$RUNNER_OS" != "Windows" ]]; then + if [[ "$VERSION" == "nightly-latest" && "$RUNNER_OS" != "Windows" ]]; then extension="tar.zst" else extension="tar.gz" fi - if [[ ${{ inputs.use-all-platform-bundle }} == "true" ]]; then + if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then artifact_name="codeql-bundle.$extension" elif [[ "$RUNNER_OS" == "Linux" ]]; then artifact_name="codeql-bundle-linux64.$extension" @@ -59,14 +62,14 @@ runs: exit 1 fi - if [[ ${{ inputs.version }} == "nightly-latest" ]]; then + if [[ "$VERSION" == "nightly-latest" ]]; then 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 - version=`echo ${{ inputs.version }} | sed -e 's/^.*\-//'` + elif [[ "$VERSION" == *"nightly"* ]]; then + version=`echo "$VERSION" | sed -e 's/^.*\-//'` 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/^.*\-//'` + elif [[ "$VERSION" == *"stable"* ]]; then + version=`echo "$VERSION" | sed -e 's/^.*\-//'` echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT else echo "::error::Unrecognized version specified!" diff --git a/.github/actions/release-branches/action.yml b/.github/actions/release-branches/action.yml index 6dee85a65e..1807c0a3c0 100644 --- a/.github/actions/release-branches/action.yml +++ b/.github/actions/release-branches/action.yml @@ -18,8 +18,11 @@ runs: using: "composite" steps: - id: branches + env: + MAJOR_VERSION: ${{ inputs.major_version }} + LATEST_TAG: ${{ inputs.latest_tag }} run: | python ${{ github.action_path }}/release-branches.py \ - --major-version ${{ inputs.major_version }} \ - --latest-tag ${{ inputs.latest_tag }} + --major-version "$MAJOR_VERSION" \ + --latest-tag "$LATEST_TAG" shell: bash