Skip to content

Add GHA workflow to auto-apply Servicing-consider label on servicing branch PRs - #54641

Merged
marcpopMSFT merged 10 commits into
mainfrom
copilot/add-gha-workflow-servicing-approval
Jun 9, 2026
Merged

marcpopMSFT merged 10 commits into
mainfrom
copilot/add-gha-workflow-servicing-approval

Conversation

Copilot AI commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

The Servicing-consider label blocks PR merges via pr-analysis.yml, but previously had to be manually applied — creating risk of accidentally merging new features into servicing branches without tactics approval.

Changes

  • New workflow .github/workflows/add-servicing-consider-label.yml:

    • Triggers on pull_request_target (opened, reopened, ready_for_review) for PRs targeting version-like release/[0-9]* branches (e.g. release/8.0, release/10.0) — excludes non-version branches like release/dnup
    • Automatically applies Servicing-consider label to qualifying PRs
    • Exempt: codeflow bot PRs — bot-authored PRs that do not carry the backport label (covers inter-branch merge flow via github-actions[bot] and darc subscriptions via dotnet-maestro[bot])
    • Not exempt: backport PRs (bot-authored but labeled backport) — these do receive Servicing-consider automatically
    • Exempt: test-only PRs — all changed files fall under test/
    • Exempt: PRs already labeled Servicing-consider or Servicing-approved
    • Paginates file listing to correctly handle large PRs
  • Docs documentation/project-docs/SDK-PR-guide.md: documents the new auto-labeling behavior and which PR types are exempt

Copilot AI changed the title [WIP] Add GHA workflow for auto-labeling features on servicing branches Add GHA workflow to auto-apply Servicing-consider label on servicing branch PRs Jun 8, 2026
Copilot AI requested a review from baronfel June 8, 2026 15:10
Copilot AI requested a review from baronfel June 8, 2026 15:21
@baronfel

baronfel commented Jun 8, 2026

Copy link
Copy Markdown
Member

Need to do a zizmor pass on this.

- 'release/9.*'
- 'release/10.*'
- 'release/11.*'
- 'release/**'

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.

@copilot we need to skip release/dnup - can the pattern enforce a constraint that the branch name looks like a version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the branch pattern to release/[0-9]* — this matches only branches whose name starts with a digit after release/ (e.g. release/8.0, release/10.0, release/8.0.1xx) and excludes non-version branches like release/dnup. Commit 9183db5.

Copilot AI requested a review from baronfel June 8, 2026 16:06
@baronfel
baronfel requested a review from a team June 8, 2026 16:32
@baronfel
baronfel marked this pull request as ready for review June 8, 2026 16:32
Copilot AI review requested due to automatic review settings June 8, 2026 16:32

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

This PR introduces automation to prevent accidental merges into servicing branches without tactics review by automatically applying the Servicing-consider blocking label on qualifying PRs targeting versioned release/* branches, and documents the new behavior.

Changes:

  • Add a new pull_request_target workflow that auto-applies Servicing-consider for PRs targeting release/[0-9]*, with exemptions for codeflow bot PRs (intended) and test-only PRs.
  • Add pagination when listing PR files to correctly detect test-only PRs for large changes.
  • Update the SDK PR guide to document the new auto-labeling behavior and exemptions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/add-servicing-consider-label.yml Adds the GitHub Actions workflow that applies Servicing-consider based on target branch, author/labels, and changed-file scope.
documentation/project-docs/SDK-PR-guide.md Documents the new auto-labeling behavior and exemption cases for servicing-branch PRs.

baronfel and others added 2 commits June 8, 2026 11:35
- Pin actions/github-script to commit SHA (f28e40c7) instead of tag v7
- Add zizmor ignore comment for pull_request_target (safe: no PR code checkout)

Co-authored-by: Copilot <[email protected]>
- Fix misleading comment: guard checks repo name, not fork status
- Narrow bot exemption to specific codeflow bots instead of all bots
- Fix doc to match actual branch pattern (release/[0-9]*)

Co-authored-by: Copilot <[email protected]>
@marcpopMSFT
marcpopMSFT merged commit 5a158a8 into main Jun 9, 2026
26 checks passed
@marcpopMSFT
marcpopMSFT deleted the copilot/add-gha-workflow-servicing-approval branch June 9, 2026 20:21
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a GHA workflow that would prevent merging features on servicing branches without going through servicing approval

4 participants