Repository navigation
Add milestone auto-assignment workflow (temporary policy bot replacement) - #16167
Conversation
Temporary replacement for the gitops policy bot milestone assignment that broke during the dotnet/aspire to microsoft/aspire repo migration on 3/20. The workflow triggers on PR merge and assigns milestones based on the target branch: main -> 13.3, release/13.2 -> 13.2.x. Can be removed once the policy bot is fixed. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a GitHub Actions workflow to automatically assign milestones to merged PRs based on the PR’s target branch, as a temporary replacement for the broken policy bot milestone assignment.
Changes:
- Introduces a
pull_request_targetworkflow that runs on PR close events and gates onmerged == true. - Maps target branches to milestone titles and assigns the matching milestone dynamically (no hardcoded milestone IDs).
- Skips execution for unmapped branches or when the correct milestone is already set.
| const milestones = await github.rest.issues.listMilestones({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'open', |
There was a problem hiding this comment.
The lookup is restricted to state: 'open', which will fail if the target milestone is closed (or temporarily closed) even though it may still be the desired assignment target. If assigning to closed milestones is acceptable in your process, consider using state: 'all' (or a fallback strategy) to avoid unexpected failures when milestone state changes.
| state: 'open', | |
| state: 'all', |
- Remove pull-requests: write (only issues: write is needed) - Use github.paginate for milestone lookup to handle repos with many milestones Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16167Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16167" |
Ankit Jain (radical)
left a comment
There was a problem hiding this comment.
Looks good — clean, minimal workflow with appropriate security posture (no checkout with pull_request_target), least-privilege permissions, idempotent milestone assignment, and proper pagination. Ship it! 🚢
…ent) (#16167) * Add GitHub Actions workflow for auto-assigning milestones to merged PRs Temporary replacement for the gitops policy bot milestone assignment that broke during the dotnet/aspire to microsoft/aspire repo migration on 3/20. The workflow triggers on PR merge and assigns milestones based on the target branch: main -> 13.3, release/13.2 -> 13.2.x. Can be removed once the policy bot is fixed. Co-authored-by: Copilot <[email protected]> * Fix milestone list to only query open milestones Co-authored-by: Copilot <[email protected]> * Address Copilot review: drop unused permission, paginate milestones - Remove pull-requests: write (only issues: write is needed) - Use github.paginate for milestone lookup to handle repos with many milestones Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Ankit Jain <[email protected]>
|
🎬 CLI E2E Test Recordings — 71 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #24417088570 |
Description
Adds a GitHub Actions workflow to automatically assign milestones to merged PRs based on their target branch. This is a temporary replacement for the gitops policy bot milestone assignment that broke during the
dotnet/aspiretomicrosoft/aspirerepo migration on 3/20.Branch to Milestone Mapping
mainrelease/13.2How it works
pull_request_targetclose eventsCleanup
This workflow can be removed once the gitops policy bot is fixed for the
microsoftorg.