-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Cancel previous running workflows when a new commit is made #23587
Conversation
Size Change: 0 B Total Size: 1.13 MB ℹ️ View Unchanged
|
61cc4e8
to
673f0f9
Compare
673f0f9
to
779cd00
Compare
I know little about GitHub actions. I can approve just to validate it in action. @youknowriad what do you think? |
.github/workflows/cancel.yml
Outdated
@@ -0,0 +1,15 @@ | |||
name: Cancel | |||
on: [push] |
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.
push only runs if you have the rights on the repository, not if you make a PR from a fork. How can we ensure to run this on fork PRs updates too?
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.
I changed it to trigger only on pull_request
events, which should run on forked repos as well: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-events-for-forked-repositories
Most of the current workflows are already triggered on pull_request
and some also on push
to master
. This way it won't cancel those triggered via push
to master
and maybe that's better.
Github should probably do this by default but this is cool in the meantime. |
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.
Let's try it.
This job is cool but it triggers too many email notifications for me so i end up missing the good notifications. Any way we can disable notifications just for this job? |
What kind of notifications? Do you mean ones with titles starting with |
yes, these notifications. I can filter in my own client but I'm pretty sure it's an annoyance for most folks. |
Yeah I think that's the case, maybe we can send feedback about it using this form: https://support.github.com/contact/feedback?contact%5Bcategory%5D=actions |
Description
Added a new GitHub action workflow named
Cancel
using styfle/cancel-workflow-action to cancel all running workflows on a branch when a new commit is made.How has this been tested?
See the commits
Test 1
andTest 2
cancelling previous runs. Force-pushes also work.