Skip to content
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

Fork-based setup seems to cancel itself and not the target workflows #139

Closed
agherzan opened this issue Feb 19, 2022 · 7 comments
Closed

Comments

@agherzan
Copy link

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.

@styfle
Copy link
Owner

styfle commented Feb 22, 2022

The workflow_id should be another workflow id (or workflow name), not itself.

See the README.md for example usage.

@agherzan
Copy link
Author

@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?

@styfle
Copy link
Owner

styfle commented Feb 22, 2022

That feature was added in #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

@agherzan
Copy link
Author

@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?

@styfle
Copy link
Owner

styfle commented Feb 22, 2022

I think pull_request_target is necessary for forks if I remember correctly

@agherzan
Copy link
Author

@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.

@styfle
Copy link
Owner

styfle commented Oct 3, 2023

Looks like someone linked an issue with an example:

@styfle styfle closed this as completed Oct 3, 2023
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

No branches or pull requests

2 participants