crazy-matt/Manage Stale Branches
This action deletes branches that have not had a commit in the last `stale-duration` (hours, days or weeks).
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| github-token | GitHub Token with repository write access. | no | ${{ github.token }} |
| stale-duration | Time threshold for stale branches (e.g., "60d", "2w", "1440h"). Accept only a single unit. | no | 60d |
| suggested-duration | Time threshold for suggested branches (e.g., "30d", "1w", "720h"). Accept only a single unit. | no | 30d |
| concurrency | Number of branches to process concurrently. | no | 4 |
| dry-run | Run in dry-run mode (no actual deletion). | no | true |
| archive-stale | Archive instead of deleting stale branches. | no | false |
| exclude-patterns | Branches to exclude from cleanup. It can be a comma-separated list or a multiline string (yaml list). It can use regex patterns. | no | "" |
| rate-limit-threshold | GitHub API rate limit threshold percentage (0-100). The action will exit gracefully when the rate limit usage reaches this threshold. The action defaults to no threshold (100). | no | 100 |
Outputs
| name | description |
|---|---|
| summary | Summary of deleted/suggested branches. |
| merged-branches | JSON array string listing the merged branches which have been deleted. Used in dry-run mode, you can pass it easily to a matrix job to handle yourself these branches. |
| merged-branches-count | Deleted merged branches count. |
| stale-branches | JSON array string listing the stale branches. Used in dry-run mode, you can pass it easily to a matrix job to handle yourself these branches. |
| stale-branches-count | Stale branches count. |
| suggested-branches | JSON array string listing the branches suggested for deletion. Used in dry-run mode, you can pass it easily to a matrix job to handle yourself these branches. |
| suggested-branches-count | Suggested branches count. |