Skip to content

Label pull requests by changed files and linked issue type - #5643

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
ci/pr-auto-labels
Oct 30, 2026
Merged

Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
ci/pr-auto-labels

Conversation

@GabrielDuf

@GabrielDuf Gabriel Dufresne (GabrielDuf) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Issues are labeled by the triage workflow, but PRs are left unlabeled unless a bot opens them. This adds labeling for PRs without using AI.

.github/labeler.yml + .github/workflows/pr-labeler.yml

  • actions/labeler@v7 adds winget, scoop, chocolatey, pip, npm, powershell, cargo, dotnet-tool or vcpkg when the PR changes that manager's project folder, appearance for Assets/Styles, and translations for non-English language files. lang_en.json is excluded because most feature PRs add strings to it.
  • A labeling run that would add more than three area labels adds none (changed-files-labels-limit: 3), so a cross-cutting refactor isn't plastered with labels. The cap applies per run, not per PR: labels already on the PR don't count, so a PR that grows into more areas over several pushes can still end up with more than three.
  • A second step copies the bug / new-feature / enhancement label from the issues the PR closes. It only does this when the PR has no type label yet and the linked issues agree on exactly one.
  • Runs on pull_request_target so fork PRs can be labeled. It never checks out PR code, and the labeler reads its config from the base branch.

.github/release.yml

  • Groups the notes GitHub generates for a release ("Generate release notes" / gh release create --generate-notes) under New features, Improvements, Bug fixes, Translations and Other, and leaves out Dependabot / github_actions bumps. It has no effect unless that feature is used.

Pull requests were left unlabeled unless a bot opened them. Path rules
now add the package-manager, translations and appearance labels, and a
pull request that closes an issue inherits its bug / new-feature /
enhancement label when the linked issues agree on one.

translations only counts non-English language files, since most feature
PRs add strings to lang_en.json. A PR touching more than three areas gets
no area label. The workflow runs on pull_request_target and never checks
out PR code, and the labeler reads its config from the base branch.

release.yml groups generated release notes by those type labels and
leaves Dependabot bumps out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

🟡 Changes recommended

The labeler configuration counts only newly added labels, allowing previously labeled PRs to exceed the intended three-area cutoff.

1 open issue
What changed in this PR

Adds non-AI pull request labeling to complement issue triage and organize GitHub-generated release notes.

Changes:

  • Maps changed paths to package-manager, appearance, and translation labels, excluding English-only translation changes.
  • Adds a fork-compatible workflow that labels PRs without checking out their code and inherits an unambiguous type label from linked issues.
  • Groups generated release notes by type and excludes dependency updates.
File Description
.github/​workflows/​pr-labeler.yml Runs path-based labeling and linked-issue type inheritance.
.github/​release.yml Defines release-note categories and exclusions.
.github/​labeler.yml Defines path rules and the changed-file label limit.

Review effort: Balanced

Comment thread .github/labeler.yml Resolved

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 This pull request will not be approved automatically: it modifies files listed in human-review-paths, so a human review is required.

  • .github/labeler.yml matches .github/
  • .github/release.yml matches .github/
  • .github/workflows/pr-labeler.yml matches .github/
Integration Details
{
	"deliveryId": "cc583ff0-d46f-11f1-8fa7-7ed3bc34b95d",
	"headSha": "a28c4b55d3870a95a8854ad1417d4d5c1790fbb0"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit edee50c into main Oct 30, 2026
1 check passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the ci/pr-auto-labels branch October 30, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants