Skip to content

delete-gh-workflow-runs is a command-line tool that deletes GitHub Actions workflow runs.

License

Notifications You must be signed in to change notification settings

christosgalano/delete-gh-workflow-runs

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

delete-gh-workflow-runs

Go Report Card Go Reference Github Downloads

Table of contents

Description

delete-gh-workflow-runs is a command-line tool that deletes GitHub Actions workflow runs based on the provided input.

Installation

Homebrew

brew tap christosgalano/christosgalano
brew install delete-gh-workflow-runs

Go

go install github.com/christosgalano/delete-gh-workflow-runs/cmd/delete-gh-workflow-runs@latest

Binary

Download the latest binary from the releases page.

Requirements

To run delete-gh-workflow-runs, you must have a GitHub token with the repo scope and workflow permissions.

Permissions

Usage

delete-gh-workflow-runs is a command-line tool that deletes GitHub Actions workflow runs based on the provided input.

Arguments:

  • --owner - The owner of the repository.
  • --repo - The name of the repository.
  • --workflow - The name of the workflow or "all" to delete all workflow runs; default is "all".
  • --token - The GitHub token.

NOTE: Only 'completed' workflow runs are considered for deletion.

Example usage

Delete the runs of a specific workflow:

delete-gh-workflow-runs --owner {owner} --repo {repo} --workflow {workflow} --token {token}

Delete all workflow runs of a repository:

delete-gh-workflow-runs --owner {owner} --repo {repo} --token {token}

GitHub Action

You can use this tool as a GitHub Action. Here is an example:

Syntax

uses: christosgalano/delete-gh-workflow-runs@v1.0.0
with:
  owner: ${{ github.repository_owner }}   # The owner of the repository
  repo: ...                               # The name of the repository
  workflow: "all"                         # The name of the workflow or "all" to delete all workflow runs
  token: ${{ github.TOKEN }}              # The GitHub token

Examples

Delete the runs of a specific workflow:

- name: Delete workflow runs
  uses: christosgalano/delete-gh-workflow-runs@v1.0.0
  with:
    owner: ${{ github.repository_owner }}
    repo: ${{ inputs.repository }}
    workflow: ${{ inputs.workflow }}
    token: ${{ github.TOKEN }}

Delete all workflow runs of a repository:

- name: Delete all workflow runs
  uses: christosgalano/delete-gh-workflow-runs@v1.0.0
  with:
    owner: ${{ github.repository_owner }}
    repo: ${{ inputs.repository }}
    token: ${{ github.TOKEN }}

Contributing

Information about contributing to this project can be found here.

License

This project is licensed under the MIT License.

About

delete-gh-workflow-runs is a command-line tool that deletes GitHub Actions workflow runs.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published