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 |
styfle
left a comment
There was a problem hiding this comment.
Lets rename the option ignore_sha and it should be optional, not required
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
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