Skip to content
x-circle

GitHub Action

Auto Cancel Redundant Workflow

v1.7.5 Latest version

Auto Cancel Redundant Workflow

x-circle

Auto Cancel Redundant Workflow

GitHub Actions to automatically cancel redundant workflow

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Auto Cancel Redundant Workflow

uses: technote-space/auto-cancel-redundant-workflow@v1.7.5

Learn more about this action in technote-space/auto-cancel-redundant-workflow

Choose a version

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