ci(framework): close a milestone when its last issue closes#432
Merged
Conversation
A milestone stays open after all its issues are done, so its Friday due date reads as overdue and the roadmap view keeps showing the finished group. GitHub has no native rule for it. This closes any open milestone with at least one closed issue and zero open ones; an empty milestone is left alone. Runs on issue close and a weekly cron. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
A milestone stays
openafter its last issue closes. Its Friday due date then reads as overdue (see #6 "Onboard new users": 6/6 closed, due 2026-07-10, still open on 2026-07-13), and a roadmap view keeps rendering the finished group. GitHub Projects has no rule to close a milestone or hide a finished group — the built-in workflows only set item fields.🛠️ How it works
close-finished-milestones.ymlcloses any open milestone withclosed_issues > 0 && open_issues == 0.closed_issues > 0guard leaves an empty milestone alone — a freshly created bucket is not finished work.issues: [closed](the moment a milestone can become finished) and a Monday cron as a safety net.GITHUB_TOKENwithissues: write. No App token — closing a milestone is the issues API, no cross-branch push.open_issues > 0and skips it.Dry-run against the live repo:
schedule,issues, andworkflow_dispatchtriggers run only from the default branch (main). Merged here intonext, the workflow does nothing until it reachesmainvia the weekly promotion. First real run is the Monday cron after that promotion, or the next issue close onmain.🧪 How to verify
Once on
main:workflow_dispatchit, then confirm #6 flips to closed.✅ I certify