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

Fix #2711: Improve workflow cancellation support in CI #2890

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/workflow_canceller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ name: Automatic Workflow Canceller
# hash of the tip of the branch to ensure it doesn't cancel previous workflows that aren't related
# to the branch being evaluated.
on:
workflow_dispatch:
pull_request:
push:
branches:
# Push events on develop branch
- develop
workflow_run:
workflows: ["Build Tests", "Unit Tests (Robolectric -- Gradle)", "Static Checks", "Unit Tests (Robolectric - Bazel)"]
types:
- requested

jobs:
cancel:
name: Cancel Previous Runs
runs-on: ubuntu-18.04
steps:
# See https://github.com/styfle/cancel-workflow-action for details on this workflow.
- uses: styfle/cancel-workflow-action@0.6.0
# See https://github.com/styfle/cancel-workflow-action#advanced-pull-requests-from-forks for details on this workflow.
- uses: styfle/cancel-workflow-action@0.8.0
with:
workflow_id: main.yml
access_token: ${{ github.token }}
workflow_id: ${{ github.event.workflow.id }}