Tools: GitHub Actions Has a Cleanup Problem — So I Built a Tool

Tools: GitHub Actions Has a Cleanup Problem — So I Built a Tool

Source: Dev.to

gh-prune 🧹 ## The Problem ## What is gh-prune? ## Key Features ## Prerequisites ## Installation Keep your GitHub Actions clean. No more ghost workflows. If you use GitHub Actions regularly, you’ve probably noticed something odd: Then comes the painful part: As a DevOps engineer, this felt like unnecessary friction. gh-prune solves this. gh-prune is a Python-based CLI tool built on top of the GitHub CLI. It is designed to inspect your repository, identify workflow runs, and help you bulk-delete old or unwanted history to properly clean up the Actions UI. Because gh-prune leverages the official GitHub CLI for authentication and API interaction, you must have it installed and authenticated. gh-prune is available on PyPI. You can install it via pip: Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK: __ / | ______ $$ |____ ______ ______ __ __ _______ ______ / \ $$ \ ______ / \ / \ / | / |/ \ / \ /$$$$$$ |$$$$$$$ |/ |/$$$$$$ |/$$$$$$ |$$ | $$ |$$$$$$$ |/$$$$$$ | $$ | $$ |$$ | $$ |$$$$$$/ $$ | $$ |$$ | $$/ $$ | $$ |$$ | $$ |$$ $$ | $$ \__$$ |$$ | $$ | $$ |__$$ |$$ | $$ \__$$ |$$ | $$ |$$$$$$$$/ $$ $$ |$$ | $$ | $$ $$/ $$ | $$ $$/ $$ | $$ |$$ | $$$$$$$ |$$/ $$/ $$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$$/ / \__$$ | $$ | $$ $$/ $$ | $$$$$$/ $$/ Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: __ / | ______ $$ |____ ______ ______ __ __ _______ ______ / \ $$ \ ______ / \ / \ / | / |/ \ / \ /$$$$$$ |$$$$$$$ |/ |/$$$$$$ |/$$$$$$ |$$ | $$ |$$$$$$$ |/$$$$$$ | $$ | $$ |$$ | $$ |$$$$$$/ $$ | $$ |$$ | $$/ $$ | $$ |$$ | $$ |$$ $$ | $$ \__$$ |$$ | $$ | $$ |__$$ |$$ | $$ \__$$ |$$ | $$ |$$$$$$$$/ $$ $$ |$$ | $$ | $$ $$/ $$ | $$ $$/ $$ | $$ |$$ | $$$$$$$ |$$/ $$/ $$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$$/ / \__$$ | $$ | $$ $$/ $$ | $$$$$$/ $$/ COMMAND_BLOCK: __ / | ______ $$ |____ ______ ______ __ __ _______ ______ / \ $$ \ ______ / \ / \ / | / |/ \ / \ /$$$$$$ |$$$$$$$ |/ |/$$$$$$ |/$$$$$$ |$$ | $$ |$$$$$$$ |/$$$$$$ | $$ | $$ |$$ | $$ |$$$$$$/ $$ | $$ |$$ | $$/ $$ | $$ |$$ | $$ |$$ $$ | $$ \__$$ |$$ | $$ | $$ |__$$ |$$ | $$ \__$$ |$$ | $$ |$$$$$$$$/ $$ $$ |$$ | $$ | $$ $$/ $$ | $$ $$/ $$ | $$ |$$ | $$$$$$$ |$$/ $$/ $$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$$/ / \__$$ | $$ | $$ $$/ $$ | $$$$$$/ $$/ CODE_BLOCK: gh auth login CODE_BLOCK: gh auth login COMMAND_BLOCK: pip install gh-prune Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: pip install gh-prune COMMAND_BLOCK: pip install gh-prune - You delete a workflow file (.github/workflows/old-flow.yml). - But the workflow still appears in the Actions tab. - Clicking through runs one by one. - Manually deleting history. - Realizing there’s no native bulk cleanup button. - 🔍 Inspect GitHub Actions workflows. - 📋 List workflow runs clearly. - 🗑️ Bulk Delete old or unwanted runs. - ✨ Clean the Actions UI of "deleted" workflows that persist in history. - Install GitHub CLI: Installation Guide - Authenticate: gh auth login