Skip to content

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

Conversation

jsoberg
Copy link
Contributor

@jsoberg jsoberg commented Sep 4, 2022

fixes #42 - Add a startsWith check that verifies the PR being merged in is from a release/<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

Verifies that the PR being merged in is from a `release/<version>` branch, skipping the workflow if it is not.
@jsoberg jsoberg changed the title #42 - Add a startsWith check to publish-new-release workflow fixes #42 - Add a startsWith check to publish-new-release workflow Sep 4, 2022
Copy link
Owner

@thomaseizinger thomaseizinger left a 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/')
Copy link
Owner

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.

Copy link
Contributor Author

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/')

@thomaseizinger
Copy link
Owner

Cool, thank you for the contribution!

@thomaseizinger thomaseizinger merged commit ff3ab31 into thomaseizinger:dev Sep 15, 2022
@thomaseizinger
Copy link
Owner

Actually, would you mind sending a follow-up PR that adds an entry to the changelog?

@jsoberg
Copy link
Contributor Author

jsoberg commented Sep 15, 2022

Oh yeah, no worries!

@jsoberg
Copy link
Contributor Author

jsoberg commented Sep 15, 2022

Would drafting a 2.1.0 release be appropriate here, updating the changelog in that PR?

@thomaseizinger
Copy link
Owner

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!

@thomaseizinger
Copy link
Owner

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.

https://github.com/thomaseizinger/github-action-gitflow-release-workflow/actions/runs/3065049502/jobs/4948757562#step:9:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish-release workflow will run for non-release branches
2 participants