Skip to content

Installation and Usage

Lucas edited this page Mar 6, 2026 · 18 revisions

Installation and Usage

Requirements

  • macOS terminal
  • GitHub CLI (gh)
  • a GitHub account authenticated with gh auth login

Install

From the project folder:

chmod +x gh-actions-cleanup install-gh-actions-cleanup.sh
./install-gh-actions-cleanup.sh

If the installer uses ~/.local/bin and that path is not already in your shell PATH, add the export line printed by the installer into ~/.zshrc, then open a new terminal.

Interactive Use

gh-actions-cleanup

The CLI can prompt for:

  • GitHub host
  • authenticated account
  • repository owner
  • repository name
  • cleanup actions

Common Commands

Full cleanup:

gh-actions-cleanup --repo OWNER/REPO --all --yes

Dry run:

gh-actions-cleanup --repo OWNER/REPO --all --dry-run --yes

Disable workflows only:

gh-actions-cleanup --repo OWNER/REPO --disable-workflows --yes

Delete workflow runs only:

gh-actions-cleanup --repo OWNER/REPO --delete-runs --yes

Delete artifacts only:

gh-actions-cleanup --repo OWNER/REPO --delete-artifacts --yes

Delete caches only:

gh-actions-cleanup --repo OWNER/REPO --delete-caches --yes

Notes

  • The command uses the selected active GitHub account on the selected host.
  • If multiple accounts are authenticated on one host, the CLI can switch with gh auth switch.
  • The token in use needs repository and workflow access to delete Actions resources.
  • --dry-run is the safest way to verify intended changes before deleting Actions data.

Clone this wiki locally