Skip to content

Commit

Permalink
fix: Fix base branch identifier for pull requests in release workflow (
Browse files Browse the repository at this point in the history
…#16)

When releasing from branches containing a `/` the gh CLI call to open a
pull request specified an invalid base branch by passing `--base
"${GITHUB_REF##*/}"` which would chomp everything before a `/` in the
current GITHUB_REF (which contains refs/heads/<branchname> or
refs/tags/<tagname>). This would mangle the branch name if it contains a
`/` character so we use GITHUB_REF_NAME instead which should not contain
any prefix.

Signed-off-by: Paolo Chila <[email protected]>
  • Loading branch information
pchila authored Mar 8, 2022
1 parent b151dd6 commit 605b380
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
RELEASE_TAG: ${{ steps.create-release-package.outputs.tag-name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --title "chore: Release notes for $RELEASE_TAG" --body "**This is an automated PR for release notes of $RELEASE_TAG!**" --base "${GITHUB_REF##*/}"
gh pr create --title "chore: Release notes for $RELEASE_TAG" --body "**This is an automated PR for release notes of $RELEASE_TAG!**" --base "${GITHUB_REF_NAME}"
- name: Create GitHub Release
Expand Down

0 comments on commit 605b380

Please sign in to comment.