Construct target branch name in checks step

This commit is contained in:
Michael B. Gale
2025-06-23 15:00:45 +01:00
parent 9ee60a6e32
commit 6a3692d673

View File

@@ -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}" \