Skip to content

Commit 3046500

Browse files
committed
Construct target branch name in checks step
1 parent 58ac32c commit 3046500

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/update-proxy-release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ jobs:
2222
RELEASE_TAG: ${{ inputs.tag || 'codeql-bundle-v2.22.0' }}
2323
steps:
2424
- name: Check release tag format
25+
id: checks
2526
shell: bash
2627
run: |
2728
if ! [[ $RELEASE_TAG =~ "^codeql-bundle-v[0-9]+\.[0-9]+\.[0-9]+$" ]]; then
2829
echo "Invalid release tag: expected a CodeQL bundle tag in the 'codeql-bundle-vM.N.P' format."
2930
exit 1
3031
fi
3132
33+
echo "target_branch=dependency-proxy/$RELEASE_TAG" >> $GITHUB_OUTPUT
34+
3235
- name: Check that the release exists
3336
shell: bash
3437
env:
@@ -61,7 +64,6 @@ jobs:
6164
- name: Push changes and open PR
6265
shell: bash
6366
env:
64-
BRANCH: "dependency-proxy/${{ env.RELEASE_TAG }}"
6567
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
6668
run: |
6769
set -exu
@@ -77,16 +79,16 @@ jobs:
7779
EOF
7880
)
7981
80-
git checkout -b "$BRANCH"
82+
git checkout -b "${{ steps.checks.outputs.target_branch }}"
8183
8284
npm run build
8385
git add ./src/start-proxy-action.ts
8486
git add ./lib
8587
git commit -m "$pr_title"
8688
87-
git push origin "$BRANCH"
89+
git push origin "${{ steps.checks.outputs.target_branch }}"
8890
gh pr create \
89-
--head "$BRANCH" \
91+
--head "${{ steps.checks.outputs.target_branch }}" \
9092
--base "main" \
9193
--title "${pr_title}" \
9294
--body "${pr_body}" \

0 commit comments

Comments
 (0)