Skip to content

Commit

Permalink
Enable Canceling Previous Workflows on PRs from Forks [SAME VERSION] (#…
Browse files Browse the repository at this point in the history
…284)

* use workflow_run trigger in cancel workflow

* only run cancel workflow explicitly for pull_request events
  • Loading branch information
kate-goldenring committed Mar 26, 2021
1 parent b3410c8 commit 302af3b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/cancel-previous-pr-workflows.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Cancel Previous PR Workflows
on:
pull_request:
branches: [ main ]
workflow_run:
workflows: ["Dependencies autoupdate", "Build Agents", "Build Anomaly Detection App Container", "Build Controller", "Build ONVIF Broker (.NET)", "Build OPC UA Monitoring Broker", "Build OpenCV Base", "Build Production Rust Code", "Build Rust CrossBuild", "Build UDEV Broker", "Build Video Streaming App Container", "Build Webhook Configuration", "Check Rust", "Check versioning", "Helm", "Tarpaulin Code Coverage", "Test K3s, Kubernetes, and MicroK8s"]
types:
- requested
jobs:
cancel:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
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, check-rust.yml, check-versioning.yml, run-helm.yml, run-tarpaulin.yml, run-test-cases.yml"
workflow_id: ${{ github.event.workflow.id }}

0 comments on commit 302af3b

Please sign in to comment.