|
| 1 | +# Prepare Release Milestone |
| 2 | + |
| 3 | +Prepare release tracking on GitHub without creating a release. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +1. Describe the release preparation workflow before taking action: |
| 8 | + - Confirm the destination milestone exists or create it. |
| 9 | + - Move the closed issues and closed pull requests from the source milestone to the destination milestone. |
| 10 | + - Verify that every moved issue and pull request has at least one allowed label. |
| 11 | + - Do not create a GitHub release. |
| 12 | +2. Ask the user for both: |
| 13 | + - Source milestone |
| 14 | + - Destination milestone |
| 15 | +3. Use only these allowed labels when validating moved items: |
| 16 | + - breaking change |
| 17 | + - bug |
| 18 | + - dependencies |
| 19 | + - documentation |
| 20 | + - feature |
| 21 | + - improvement |
| 22 | + - build |
| 23 | +4. Treat an item as invalid if: |
| 24 | + - It has no labels. |
| 25 | + - None of its labels are in the allowed list. |
| 26 | +5. Report any invalid items clearly and stop before any release creation step. |
| 27 | +6. Keep the response concise and operational. |
| 28 | + |
| 29 | +## Operational Steps |
| 30 | + |
| 31 | +1. Ask: |
| 32 | + - Source milestone? |
| 33 | + - Destination milestone? |
| 34 | + |
| 35 | +2. Summarize the plan: |
| 36 | + - Check whether the destination milestone already exists. |
| 37 | + - Create the destination milestone if needed. |
| 38 | + - Find closed issues in the source milestone. |
| 39 | + - Find closed pull requests in the source milestone. |
| 40 | + - Move those closed items to the destination milestone. |
| 41 | + - Verify labels on all moved items using the allowed label list. |
| 42 | + - Do not create a release. |
| 43 | + |
| 44 | +3. Resolve milestone state: |
| 45 | + |
| 46 | +```bash |
| 47 | +gh api repos/{owner}/{repo}/milestones --paginate --jq '.[] | [.number,.title,.state] | @tsv' |
| 48 | +gh api repos/{owner}/{repo}/milestones -X POST -f title='<DESTINATION_MILESTONE>' |
| 49 | +``` |
| 50 | + |
| 51 | +4. Collect closed items from the source milestone: |
| 52 | + |
| 53 | +```bash |
| 54 | +gh issue list --repo {owner}/{repo} --milestone '<SOURCE_MILESTONE>' --state closed --limit 200 --json number,title,labels |
| 55 | +gh pr list --repo {owner}/{repo} --state closed --search 'milestone:"<SOURCE_MILESTONE>"' --limit 200 --json number,title,labels,state |
| 56 | +``` |
| 57 | + |
| 58 | +5. Move closed issues and closed pull requests to the destination milestone: |
| 59 | + |
| 60 | +```bash |
| 61 | +gh issue edit <ISSUE_NUMBER> --repo {owner}/{repo} --milestone '<DESTINATION_MILESTONE>' |
| 62 | +gh pr edit <PR_NUMBER> --repo {owner}/{repo} --milestone '<DESTINATION_MILESTONE>' |
| 63 | +``` |
| 64 | + |
| 65 | +6. Verify labels against this allowlist: |
| 66 | + |
| 67 | +```text |
| 68 | +breaking change |
| 69 | +bug |
| 70 | +dependencies |
| 71 | +documentation |
| 72 | +feature |
| 73 | +improvement |
| 74 | +build |
| 75 | +``` |
| 76 | + |
| 77 | +Validation rules: |
| 78 | +- Each moved item must have at least one label. |
| 79 | +- At least one assigned label must match the allowlist exactly. |
| 80 | +- If any moved item fails validation, report the item number, title, and labels. |
| 81 | + |
| 82 | +7. Verify final milestone state and report: |
| 83 | + |
| 84 | +```bash |
| 85 | +gh issue list --repo {owner}/{repo} --milestone '<DESTINATION_MILESTONE>' --state closed --limit 200 --json number,title,labels |
| 86 | +gh pr list --repo {owner}/{repo} --state closed --search 'milestone:"<DESTINATION_MILESTONE>"' --limit 200 --json number,title,labels,state |
| 87 | +``` |
| 88 | + |
| 89 | +Report: |
| 90 | +- Source milestone |
| 91 | +- Destination milestone |
| 92 | +- Whether the destination milestone was created or already existed |
| 93 | +- Count of moved closed issues |
| 94 | +- Count of moved closed pull requests |
| 95 | +- Any moved items missing allowed labels |
| 96 | +- Confirmation that no GitHub release was created |
0 commit comments