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 Workflow to Cancel Previous PR Workflows [SAME VERSION] #281

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/cancel-previous-pr-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Cancel Previous PR Workflows
on:
pull_request:
branches: [ main ]
jobs:
cancel:
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@0.8.0
with:
workflow_id: "auto-update-dependencies.yml, build-agent-container.yml, build-anomaly-detection-app-container.yml, build-controller-container.yml, build-onvif-video-broker-container.yml, build-opcua-monitoring-broker-container.yml, build-opencv-base-container.yml, build-rust-code.yml, build-rust-crossbuild-container.yml, build-udev-video-broker-container.yml, build-video-streaming-app-container.yml, build-webhook-configuration-container.yml, cancel-previous-pr-workflows.yml, check-rust.yml, check-versioning.yml, run-helm.yml, run-tarpaulin.yml, run-test-cases.yml, security-audit.yml"
Copy link
Contributor

Choose a reason for hiding this comment

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

We can exclude the security-audit.yml since it no longer runs on pull_requests

Copy link
Contributor

Choose a reason for hiding this comment

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

"cancel-previous-pr-workflows.yml" is included here too. Is the intention to cancel existing "cancel workflow" and then the new one will take care of cancelling other older ones? (too many "cancel" in my statement 😄)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just put all workflows here. i dont really have a strong preference around including or excluding cancel-previous-pr-workflows.yml. If you are updating the workflow in a PR then you could cancel previous instances of it, but it is such a short workflow that its not consuming time.