Skip to content

toshimaru/gh-workflow-log-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test

GitHub Workflow Log Cleaner

A GitHub CLI extension to delete outdated GitHub Actions workflow run logs in bulk.

Cover Image

Prerequisites

Install

To install the extension, run the following command:

$ gh extension install toshimaru/gh-workflow-log-cleaner

Usage

$ gh workflow-log-cleaner [<workflow-id> | <workflow-name> | <filename>] [options]

Options

Option Description
-h, --help Show help message and exit
--limit int Limit the number of runs to delete (default: 1000)

Examples

# Delete logs by workflow name
$ gh workflow-log-cleaner test

# Delete logs by workflow ID
$ gh workflow-log-cleaner 114855097

# Delete logs by filename
$ gh workflow-log-cleaner test.yml

# Delete only the last 10 runs
$ gh workflow-log-cleaner test --limit 10

# --limit can also be placed before the workflow name
$ gh workflow-log-cleaner --limit 10 test

How It Works

This extension uses the GitHub CLI under the hood:

  1. Lists workflow runs matching the given workflow identifier using gh run list
  2. Deletes each run using gh run delete

Don't know your workflow name?

Run gh workflow-log-cleaner without arguments to see available workflows:

$ gh workflow-log-cleaner
USAGE
gh workflow-log-cleaner [<workflow-id> | <workflow-name> | <filename>] [options]

OPTIONS
  -h, --help    Show this help message and exit
  --limit int   Limit the number of runs to delete (default: 1000)

EXAMPLES
  Remove logs for the test workflow
  $ gh workflow-log-cleaner test

AVAILABLE WORKFLOWS
NAME   STATE   ID
setup  active  114854128
test   active  114855097

About

A GitHub CLI extension to delete outdated GitHub Actions workflow run logs in bulk.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages