Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Delete GitHub Workflow Runs

A simple Python script to delete all GitHub Actions workflow runs from a repository using the GitHub API. Ideal for cleaning up old workflows, especially for repositories with frequent deploys.

Note: Is not committed to GitHub or stored in public files.


🔧 Features

  • Fetches workflow runs from GitHub Actions API.
  • Deletes all workflow runs in batches (100 per page).
  • Logs success and failure status for each run deletion.
  • Easy to configure with your GitHub username, repository, and token.

📦 Requirements

  • Python 3.6+
  • requests module (Install using: pip install requests)

🚀 Usage

  1. Clone this repository

    git clone https://github.com/AdityaLF/Delete-GH-Workflow-Runs.git
    cd Delete-GH-Workflow-Runs
  2. Generate your GitHub Personal Access Token (PAT):

    • Go to GitHub Token Settings.

    • Click on "Generate new token".

    • Provide a name for the token ("delworkflows-script").

    • Select the required scopes:

      • repo: needed for repository actions.

      • workflow: needed to delete workflows.

    • Click Generate token.

    • Copy the token (you won’t be able to see it again, so store it securely).

  3. Edit the configuration section at the top of the script:

    owner = 'your-username'         # Replace with your GitHub username
    repo = 'your-repository'        # Replace with your GitHub repository name
    token = 'your-github-token'     # Replace with your GitHub Personal Access Token (PAT)
  4. Run the script:

    python delworkflows.py

👤 Author


📄 License

This project is licensed under the MIT License.

About

Quickly remove all workflow runs from any GitHub repository.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages