Skip to content

bpofficial/github-artifacts-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

GitHub Artifacts Cleaner

This project provides scripts to delete all GitHub Actions artifacts from all repositories within a specified GitHub organisation.

⚠️ Warning: This action is destructive and irreversible. Once an artifact is deleted, it cannot be recovered. Use this script with extreme caution.


Prerequisites

Before you begin, ensure you have the following:

  1. GitHub Personal Access Token (PAT):

    • You need a PAT with the repo and actions:write scopes.
    • To create a token, go to GitHub's token settings page.
    • Ensure the token is authorised to access the repositories in your target organisation.
  2. Required Software:

    • curl: A command-line tool for transferring data with URLs. (Modern Windows 10/11 includes curl by default).
    • jq: A command-line JSON processor.

Installation

macOS (using Homebrew)

brew install jq

Debian/Ubuntu

sudo apt-get update && sudo apt-get install curl jq

Windows (using Chocolatey)

First, install Chocolatey. Then open an Administrator PowerShell or CMD prompt and run:

choco install jq curl

Note: curl is typically included in modern Windows versions, so you may only need to install jq.


Setup & Execution

  1. Download the appropriate script for your operating system (cleanup.sh for Linux/macOS or cleanup.bat for Windows).
  2. Open the script in a text editor.
  3. Modify the configuration variables at the top of the file:
    • Set ORG to your GitHub organisation's name.
    • Set TOKEN to your GitHub Personal Access Token.

To Run the Shell Script (Linux/macOS/WSL)

Open your terminal and run the following command:

# Make the script executable
chmod +x cleanup.sh

# Run the script
./cleanup.sh

To Run the Batch Script (Windows)

Open a Command Prompt (cmd.exe) and run the script:

cleanup.bat

About

Lightweight tool to reclaim your Github actions storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published