Skip to content
target

GitHub Action

GH actions stale run canceller

master Latest version

GH actions stale run canceller

target

GH actions stale run canceller

Shoots old builds

Installation

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

              

- name: GH actions stale run canceller

uses: yellowmegaman/gh-build-canceller@master

Learn more about this action in yellowmegaman/gh-build-canceller

Choose a version

Github Actions build canceller

A GitHub Action for cancelling old PR builds.

How it works

  • Action is looking for workflows on current repo
  • To limit in which workflows we want to kill old builds, you can use "worflow1|workflow2" as a value for workflow_filter parameter.
  • Action is looking then for older builds that have status in_progress|queued on the different GIT SHA and kills 'em

GitHub Actions

# File: .github/workflows/shot.yml
name: build_canceller
on:
  pull_request:
jobs:
  build_canceller:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: shot
      uses: yellowmegaman/[email protected]
      with:
        github_token: ${{secrets.PERSONAL_TOKEN}}
        workflows_filter: "CI|pr"

This will automatically kill all old builds on this PR branch.