From 6a3692d673d8a04b729a8468fd331197ea69aea6 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 23 Jun 2025 15:00:45 +0100 Subject: [PATCH] Construct target branch name in `checks` step --- .github/workflows/update-proxy-release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-proxy-release.yml b/.github/workflows/update-proxy-release.yml index 82d479824..b945a01f0 100644 --- a/.github/workflows/update-proxy-release.yml +++ b/.github/workflows/update-proxy-release.yml @@ -22,6 +22,7 @@ jobs: RELEASE_TAG: ${{ inputs.tag || 'codeql-bundle-v2.22.0' }} steps: - name: Check release tag format + id: checks shell: bash run: | if ! [[ $RELEASE_TAG =~ ^codeql-bundle-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then @@ -29,6 +30,8 @@ jobs: exit 1 fi + echo "target_branch=dependency-proxy/$RELEASE_TAG" >> $GITHUB_OUTPUT + - name: Check that the release exists shell: bash env: @@ -61,7 +64,6 @@ jobs: - name: Push changes and open PR shell: bash env: - BRANCH: "dependency-proxy/${{ env.RELEASE_TAG }}" GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" run: | set -exu @@ -77,16 +79,16 @@ jobs: EOF ) - git checkout -b "$BRANCH" + git checkout -b "${{ steps.checks.outputs.target_branch }}" npm run build git add ./src/start-proxy-action.ts git add ./lib git commit -m "$pr_title" - git push origin "$BRANCH" + git push origin "${{ steps.checks.outputs.target_branch }}" gh pr create \ - --head "$BRANCH" \ + --head "${{ steps.checks.outputs.target_branch }}" \ --base "main" \ --title "${pr_title}" \ --body "${pr_body}" \