Skip to content

Add milestone auto-assignment workflow (temporary policy bot replacement) - #16167

Merged
Jose Perez Rodriguez (joperezr) merged 4 commits into
mainfrom
milestone-assignment-workflow
Apr 14, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 4 commits into
mainfrom
milestone-assignment-workflow

Conversation

@joperezr

Copy link
Copy Markdown
Member

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/aspire to microsoft/aspire repo migration on 3/20.

Branch to Milestone Mapping

Target Branch Milestone
main 13.3
release/13.2 13.2.x

How it works

  • Triggers on pull_request_target close events
  • Only runs when the PR is actually merged (not just closed)
  • Skips if the correct milestone is already assigned
  • Dynamically looks up milestone numbers (no hardcoded IDs)
  • Ignores PRs targeting unmapped branches

Cleanup

This workflow can be removed once the gitops policy bot is fixed for the microsoft org.

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]>
Copilot AI review requested due to automatic review settings April 14, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_target workflow that runs on PR close events and gates on merged == 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',

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
state: 'open',
state: 'all',

Copilot uses AI. Check for mistakes.
- 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]>
@github-actions

github-actions Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16167

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16167"

@radical Ankit Jain (radical) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 🚢

@joperezr
Jose Perez Rodriguez (joperezr) merged commit 7eeb3dd into main Apr 14, 2026
4 checks passed
Ankit Jain (radical) added a commit that referenced this pull request Apr 14, 2026
…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]>
@github-actions

Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings — 71 recordings uploaded (commit 849f45c)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AllPublishMethodsBuildDockerImages ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View Recording
DeployK8sBasicApiService ▶️ View Recording
DeployK8sWithGarnet ▶️ View Recording
DeployK8sWithMongoDB ▶️ View Recording
DeployK8sWithMySql ▶️ View Recording
DeployK8sWithPostgres ▶️ View Recording
DeployK8sWithRabbitMQ ▶️ View Recording
DeployK8sWithRedis ▶️ View Recording
DeployK8sWithSqlServer ▶️ View Recording
DeployK8sWithValkey ▶️ View Recording
DeployTypeScriptAppToKubernetes ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoListStepsShowsPipelineSteps ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
OtelLogsReturnsStructuredLogsFromStarterApp ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View Recording

📹 Recordings uploaded automatically from CI run #24417088570

@joperezr Jose Perez Rodriguez (joperezr) added this to the 13.3 milestone Apr 14, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants