Automatically cleans out workflow runs from repositories
This application is written in C# using .NET 8 SDK
Release is a standalone binary, thus .NET runtime is not needed
Supports Linux x64 and Windows x64
- Download latest release for your platform
- Extract release ZIP archive
- Run using command line
This application has no GUI. You will need to use a command-line shell to launch it.
Linux
Invoke with, in a terminal emulator:
-
Set environment variables
GITHUB_OWNER=<username>
-
Run the application
./RunCleaner
-
Optionally do it all inline:
GITHUB_TOKEN=<token> GITHUB_OWNER=<username> ./RunCleaner
Windows:
-
Set environment variables
Using PowerShell:
$env:GITHUB_OWNER='<username>';
Using Command Prompt:
set GITHUB_OWNER=<username>
Using Git Bash:
GITHUB_OWNER=<username>
-
Run the application
PowerShell or Command Prompt:
.\RunCleaner.exe
Git Bash:
./RunCleaner.exe
You must provide the mandatory variables
Mandatory:
GITHUB_TOKEN
- Github PAT, must haverepo
scopeGITHUB_OWNER
- Owner of the repositories (github.repository_owner)
Optional:
EXCLUDE_PROJECTS
- Array of projects you wish to exclude in escaped JSON formatCLEAN_OLDER_THAN
- Runs that are older than the number of days declared here will get cleaned, defaults to 7
Requirement: .NET 8 SDK
Build with inside the Source
directory:
dotnet build
Clean every runs from repositories that are older than 7 days:
GITHUB_TOKEN=<token> GITHUB_OWNER=<username> ./RunCleaner
Increase maximum workflow run age to 10 days:
CLEAN_OLDER_THAN=10 GITHUB_TOKEN=<token> GITHUB_OWNER=<username> ./RunCleaner
Exclude repositories owner/repo1
and owner/repo2
from cleaning:
EXCLUDE_PROJECTS=[\"owner/repo1\", \"owner/repo2\"] GITHUB_TOKEN=<token> GITHUB_OWNER=<username> ./RunCleaner
The scripts and documentation in this project are released under the MIT License.
LinkHeader.cs - Extension of pimbrouwers's