cancel-workflow-action
cancel-workflow-action copied to clipboard
Fork-based setup seems to cancel itself and not the target workflows
I have a setup based on workflow_run
. You can see it here. For whatever reason, when running, the job seems to cancel itself as opposed to the workflow that triggered it. My setup seems to be very simple so I'm wondering if I'm missing something obvious/fundamental.
The workflow_id
should be another workflow id (or workflow name), not itself.
See the README.md for example usage.
@styfle I'm using a fork based setup so in my case the workflow_id
is ${{ github.event.workflow.id }}
. This is also in accordance with the Readme documentation. What am I missing?
That feature was added in https://github.com/styfle/cancel-workflow-action/pull/55 and looks like its untested.
You could try using this example instead: https://github.com/vercel/next.js/blob/canary/.github/workflows/cancel.yml
@styfle I guess we can consider it now tested - and failed :) I can try using pull_request_target
. Is there a reason why not use pull_request
?
I think pull_request_target
is necessary for forks if I remember correctly
@styfle could you explain it a bit? I'm not sure what you mean because I am looking for a solution to cancelling workflows when PRs are landing both from forks and from internal branches.
Looks like someone linked an issue with an example:
- https://github.com/autowarefoundation/autoware.universe/pull/1741