Skip to content

Comments

Workflow to automatically add preview/rc labels for merged PRs#37737

Merged
roji merged 3 commits intodotnet:mainfrom
roji:PreviewLabelAutomation
Feb 19, 2026
Merged

Workflow to automatically add preview/rc labels for merged PRs#37737
roji merged 3 commits intodotnet:mainfrom
roji:PreviewLabelAutomation

Conversation

@roji
Copy link
Member

@roji roji commented Feb 18, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 16:37
@roji roji requested a review from a team as a code owner February 18, 2026 16:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow intended to automatically label issues closed by PRs merged into main with the next preview/RC label, inferred from existing release/* branches.

Changes:

  • Introduces .github/workflows/label-preview-version.yml to compute the next preview-* / rc-* label based on branch names.
  • Queries closing issues for a merged PR via GraphQL and applies the computed label via the Issues API.

- Use pull_request_target instead of pull_request so fork PRs get a
  write token (the workflow doesn't execute PR code, only reads metadata)
- Add pull-requests: read permission for the GraphQL query
- Use Git refs API (listMatchingRefs) to fetch only release/ branches
  instead of listing all branches
- Label all closingIssuesReferences without filtering by CLOSED state
  to avoid race conditions with GitHub's eventual consistency

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When a PR is merged directly into a release branch (e.g.
release/11.0-preview2), derive the label from the branch name
(preview-2) instead of scanning for the next unreleased version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 19, 2026 07:53
@roji roji enabled auto-merge (squash) February 19, 2026 07:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@roji roji disabled auto-merge February 19, 2026 10:26
@roji roji merged commit fb96b4a into dotnet:main Feb 19, 2026
15 of 16 checks passed
@roji roji deleted the PreviewLabelAutomation branch February 19, 2026 10:26
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.

2 participants