Automate Repository Maintenance with New Stale Branch Cleaner and Changelog Actions
These articles are AI-generated summaries. Please check the original sources for full details.
Two More GitHub Actions: Stale Branch Cleaner + Changelog Generator
Developer Olivier Buitelaar has expanded his automation toolkit to six actions with the release of a stale branch cleaner and a changelog generator. The branch cleaner identifies and can auto-delete branches with no activity for over 90 days to prevent repository bloat.
Why This Matters
While ideal repository management suggests manual cleanup of experimental branches, technical reality often leads to dozens of temporary branches accumulating over months. Automated tools like stale-branch-cleaner enforce hygiene by identifying stale data while protecting critical branches like main and release/*, preventing CI/CD clutter and developer confusion.
Key Insights
- The stale-branch-cleaner v1 scans for branches inactive for 90+ days to reduce repository bloat and generate report tables via GitHub Issues.
- Conventional Commits such as feat, fix, and docs are used by the changelog-generator to automatically categorize updates with emojis and links.
- Smart exclusions protect core branches including main, master, develop, release/, and hotfix/ from automated deletion routines.
- The full developer toolkit now includes six specialized tools including workflow-guardian for security linting and pr-size-labeler for diff management.
Working Examples
Configuration for weekly stale branch detection with issue reporting enabled.
name: Branch Cleanup
on:
schedule:
- cron: '0 9 * * 1'
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- uses: ollieb89/stale-branch-cleaner@v1
with:
stale-days: '90'
dry-run: 'true'
create-issue: 'true'
Implementation of the automated changelog generator requiring full git history fetch.
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ollieb89/changelog-generator@v1
Practical Applications
- Use case: Enterprise repositories using stale-branch-cleaner to prune feature branches inactive for 90 days. Pitfall: Running with dry-run set to false before verifying exclusion patterns may result in the accidental deletion of long-running research branches.
- Use case: Open-source projects using changelog-generator to automatically group breaking changes and features. Pitfall: Using non-conventional commit messages will result in incomplete or uncategorized changelog outputs.
References:
Continue reading
Next article
LlamaIndex LiteParse: TypeScript-Native Spatial PDF Parsing for AI Agents
Related Content
Dynamic Parameter Handling in GitHub Actions via JSON Templating
GitHub Actions now supports dynamic parameter passing through JSON templating, enabling flexible config management.
Debugging GitHub Actions "Pending-Forever" Silent Failures
A developer encountered six consecutive release failures where GitHub Actions stalled indefinitely due to hidden macOS runner billing limits and 10x cost multipliers.
SwiftDeploy: Automating Infrastructure with OPA Guardrails and Chaos Engineering
SwiftDeploy automates infrastructure generation from a single manifest, using OPA policy gates to block deployments when CPU load exceeds thresholds.