Construct target branch name in checks step
This commit is contained in:
parent
9ee60a6e32
commit
6a3692d673
1 changed files with 6 additions and 4 deletions
10
.github/workflows/update-proxy-release.yml
vendored
10
.github/workflows/update-proxy-release.yml
vendored
|
|
@ -22,6 +22,7 @@ jobs:
|
||||||
RELEASE_TAG: ${{ inputs.tag || 'codeql-bundle-v2.22.0' }}
|
RELEASE_TAG: ${{ inputs.tag || 'codeql-bundle-v2.22.0' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check release tag format
|
- name: Check release tag format
|
||||||
|
id: checks
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if ! [[ $RELEASE_TAG =~ ^codeql-bundle-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if ! [[ $RELEASE_TAG =~ ^codeql-bundle-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
|
@ -29,6 +30,8 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "target_branch=dependency-proxy/$RELEASE_TAG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Check that the release exists
|
- name: Check that the release exists
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
|
@ -61,7 +64,6 @@ jobs:
|
||||||
- name: Push changes and open PR
|
- name: Push changes and open PR
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
BRANCH: "dependency-proxy/${{ env.RELEASE_TAG }}"
|
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
run: |
|
run: |
|
||||||
set -exu
|
set -exu
|
||||||
|
|
@ -77,16 +79,16 @@ jobs:
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
git checkout -b "$BRANCH"
|
git checkout -b "${{ steps.checks.outputs.target_branch }}"
|
||||||
|
|
||||||
npm run build
|
npm run build
|
||||||
git add ./src/start-proxy-action.ts
|
git add ./src/start-proxy-action.ts
|
||||||
git add ./lib
|
git add ./lib
|
||||||
git commit -m "$pr_title"
|
git commit -m "$pr_title"
|
||||||
|
|
||||||
git push origin "$BRANCH"
|
git push origin "${{ steps.checks.outputs.target_branch }}"
|
||||||
gh pr create \
|
gh pr create \
|
||||||
--head "$BRANCH" \
|
--head "${{ steps.checks.outputs.target_branch }}" \
|
||||||
--base "main" \
|
--base "main" \
|
||||||
--title "${pr_title}" \
|
--title "${pr_title}" \
|
||||||
--body "${pr_body}" \
|
--body "${pr_body}" \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue