This project provides scripts to delete all GitHub Actions artifacts from all repositories within a specified GitHub organisation.
Before you begin, ensure you have the following:
-
GitHub Personal Access Token (PAT):
- You need a PAT with the
repoandactions:writescopes. - To create a token, go to GitHub's token settings page.
- Ensure the token is authorised to access the repositories in your target organisation.
- You need a PAT with the
-
Required Software:
curl: A command-line tool for transferring data with URLs. (Modern Windows 10/11 includescurlby default).jq: A command-line JSON processor.
brew install jqsudo apt-get update && sudo apt-get install curl jqFirst, install Chocolatey. Then open an Administrator PowerShell or CMD prompt and run:
choco install jq curlNote: curl is typically included in modern Windows versions, so you may only need to install jq.
- Download the appropriate script for your operating system (
cleanup.shfor Linux/macOS orcleanup.batfor Windows). - Open the script in a text editor.
- Modify the configuration variables at the top of the file:
- Set
ORGto your GitHub organisation's name. - Set
TOKENto your GitHub Personal Access Token.
- Set
Open your terminal and run the following command:
# Make the script executable
chmod +x cleanup.sh
# Run the script
./cleanup.shOpen a Command Prompt (cmd.exe) and run the script:
cleanup.bat