-
Notifications
You must be signed in to change notification settings - Fork 276
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
Add auto-cancellation workflow #2361
Add auto-cancellation workflow #2361
Conversation
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.
@aaemnnosttv One comment here, but nothing blocking.
.github/workflows/cancel.yml
Outdated
WID_SB: 1979909 # storybook.yml | ||
WID_VRT: 2751946 # visual-regression.yml | ||
WID_ZIPS: 1979910 # zips.yml |
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.
According to the docs, this also supports workflow names - wouldn't this be more intuitive to use?
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.
Looking at it again, that would be okay too. I originally read the docs for that to mean you could use the actual workflow name
which I wouldn't want but it's the file name which is much more stable.
I guess it depends on how GH treats the workflow ID in relation to the file name. I would expect the ID to remain unchanged even if the workflow changed completely.
After taking a closer look at this, I found the API documentation for listing workflow runs which is what this uses (via octokit).
List all workflow runs for a workflow. You can also replace
:workflow_id
with:workflow_file_name
. For example, you could usemain.yml
. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
So that means we wouldn't need to use the full .github/workflows/zips.yml
path which is what I was thinking it would require.
File names it is then? 😄
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.
Updated to use filenames instead. It's much cleaner and doesn't require referencing something external to update. Also, the ability to use a filename instead is a feature provided by the underlying GitHub API (example) rather than the extension so this is much better I think 👍
Summary
Addresses issue #2027
Relevant technical choices
Testing
Screenshots
Checklist