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

Add option only_status #210

Merged
merged 9 commits into from Oct 3, 2023
Merged

Conversation

8666
Copy link
Contributor

@8666 8666 commented Sep 25, 2023

Developers sometimes leave the workflows in queued state. This happens when you have a protected environment and deployment is waiting for approval. They sometimes do not approve and just leave the workflow pending waiting for a merge that will start a new workflow run and deploy from there multiple merges at once.

We need to cancel the older pending ones if new PR is merged but SKIP canceling workflows that are running as it might be dangerous to interrupt it. To play it safe we introduce only_status: 'waiting' in order to avoid canceling runs with status in_progress

GitHub official implementation also does not support this option and they do not have plans to implement it soon, so we are adding it to this action

@styfle styfle changed the title Add option Add option cancel_only_queued Sep 25, 2023
@styfle styfle linked an issue Sep 25, 2023 that may be closed by this pull request
src/index.ts Outdated Show resolved Hide resolved
@8666 8666 marked this pull request as draft September 27, 2023 13:11
@8666 8666 marked this pull request as ready for review September 27, 2023 17:16
@8666 8666 requested a review from styfle September 28, 2023 13:01
the state is `waiting`
update description
@8666
Copy link
Contributor Author

8666 commented Oct 3, 2023

@styfle Any more comments?

@styfle styfle changed the title Add option cancel_only_queued Add option only_status Oct 3, 2023
Copy link
Owner

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I updated to only_status: 'waiting' for more flexibility.

@styfle styfle merged commit 96c8030 into styfle:main Oct 3, 2023
1 check passed
@8666 8666 deleted the Add-option-cancel_only_queued branch October 3, 2023 21:51
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

Successfully merging this pull request may close these issues.

Flag to pick in_progress, waiting or both to be canceled
3 participants