A GitHub CLI extension to delete outdated GitHub Actions workflow run logs in bulk.
- GitHub CLI (
gh) installed and authenticated
To install the extension, run the following command:
$ gh extension install toshimaru/gh-workflow-log-cleaner$ gh workflow-log-cleaner [<workflow-id> | <workflow-name> | <filename>] [options]| Option | Description |
|---|---|
-h, --help |
Show help message and exit |
--limit int |
Limit the number of runs to delete (default: 1000) |
# 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 testThis extension uses the GitHub CLI under the hood:
- Lists workflow runs matching the given workflow identifier using
gh run list - Deletes each run using
gh run delete
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