Skip to content

m-wayne/auto-cancel-redundant-workflow

 
 

Repository files navigation

Auto Cancel Redundant Workflow


Please note: This repository is no longer maintained.
Please use the concurrency provided by the officials instead.

Example of migration

on: push
jobs:
  test:
    steps:
      - uses: technote-space/auto-cancel-redundant-workflow@v1
      - run: echo step1
      - run: echo step2
      # ...

on: push
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
#  cancel-in-progress: true
jobs:
  test:
    steps:
      - run: echo step1
      - run: echo step2
      # ...

CI Status codecov CodeFactor License: MIT

Read this in other languages: English, 日本語.

GitHub Actions to automatically cancel redundant workflow.

Table of Contents

Details

Usage

on:
  repository_dispatch:
    types: [test]
  # push:
  # ...

name: Example
jobs:
  firstJob:
    name: First Job
    runs-on: ubuntu-latest
    steps:
        # Use this GitHub Actions at least once in this workflow as soon as possible.
      - uses: technote-space/auto-cancel-redundant-workflow@v1
        # Run any steps
      - name: any steps
        run: echo test
      # ...

  # Run any jobs
  secondJob:
    name: Second Job
    needs: firstJob
    runs-on: ubuntu-latest
    steps:
      - run: echo test

  # ...

e.g.

Screenshots

Cancelling jobs

cancelling

Cancelled workflow

cancelled

Result

result

Outputs

name description e.g.
ids Run IDs of the cancelled workflow. 1234,2345

Author

GitHub (Technote)
Blog

About

GitHub Actions to automatically cancel redundant workflow.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.7%
  • Other 1.3%