-
Notifications
You must be signed in to change notification settings - Fork 62
fixes #42 - Add a startsWith check to publish-new-release workflow #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #42 - Add a startsWith check to publish-new-release workflow #43
Conversation
Verifies that the PR being merged in is from a `release/<version>` branch, skipping the workflow if it is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Just one minor comment, otherwise this can be merged :)
@@ -11,7 +11,8 @@ jobs: | |||
release: | |||
name: Publish new release | |||
runs-on: ubuntu-latest | |||
if: github.event.pull_request.merged == true # only merged pull requests must trigger this job | |||
# only merged pull requests that begin with 'release/' must trigger this job | |||
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to handle hotfix/
as well otherwise the code from line 25-31 does not make any sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that! Updated the check to look for ('release/' || 'hotfix/')
Cool, thank you for the contribution! |
Actually, would you mind sending a follow-up PR that adds an entry to the changelog? |
Oh yeah, no worries! |
Would drafting a 2.1.0 release be appropriate here, updating the changelog in that PR? |
We can draft a new release yes! I typically always fixed up the changelog before but the release PR is a good place too! |
We are still depending on a quite old version of the create-pull-request action here so the workflow is broken :( Need to update that and probably enable dependabot in this repo. |
fixes #42 - Add a
startsWith
check that verifies the PR being merged in is from arelease/<version>
branch, skipping the workflow if it is not. This saves us from showing failed workflows for non-release PR merges.Example of this logic skipping non-release PR merges: https://github.com/jsoberg/Loot-Hoard-DnD-Discord-Bot/actions/runs/2988351427
Example of this logic triggering on release PR merges: https://github.com/jsoberg/Loot-Hoard-DnD-Discord-Bot/actions/runs/2988387989