-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Allow matching SHA to be canceled #50
Conversation
Hi @ericmatte It seems like this is only relevant for I wonder if it would be better to detect the event type and do this automatically for closed PRs rather than add a new option? |
@styfle, yes, in my case, it is only useful on
I could think of one reason: Let's say that you have two workflows which are triggered on jobs:
cleanup-after-pr-closed:
name: Cancel other workflows on failure
runs-on: ubuntu-latest
need: [other-jobs]
if: failure() # or cancelled()
steps:
uses: ericmatte/cancel-workflow-action@match-sha
with:
allow_matching_sha: true
workflow_id: 'other-workflow.yml' If you don't think that this could be a useful case, I could also change the code like you've suggested and detect the event type to do this only on closed PRs. Cheers |
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.
Lets rename the option ignore_sha
and it should be optional, not required
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Co-authored-by: Steven <[email protected]>
Hi,
I've started using your action and it is really useful!
However, their was one use case for me that was not working:
pull_request
.pull_request: types: [closed]
.The problem is that it will not cancel the latest build run if I merge that commit directly; since they both have the same SHA.
So I've added an option
allow_matching_sha
(default tofalse
) which can disable that check and allow runs with the same sha on other workflows to be cancelled.So my second workflow looks like this:
Cheers