1 | name: Cancel previous workflows |
2 | |
3 | on: |
4 | workflow_run: |
5 | workflows: ["Code CI"] |
6 | types: |
7 | - requested |
8 | |
9 | jobs: |
10 | cancel-previous-workflows: |
11 | runs-on: ubuntu-latest |
12 | steps: |
13 | - uses: spaceface777/[email protected] |
14 | # don't cancel CI for commits pushed to vlang/v#master (if ci is still too slow, this can be removed safely) |
15 | if: ${{ github.event.workflow_run.head_repository.full_name != 'vlang/v' || github.event.workflow_run.head_branch != 'master' }} |
16 | with: |
17 | # workflow ids for `Code CI` and `Sanitized CI` (from https://api.github.com/repos/vlang/v/actions/workflows): |
18 | workflow_id: 4577,7940868 # the other workflows finish quickly - no need to skip them |