Repository navigation
Project management: automate adding package-related labels to PRs #52729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2236c90
Add labeler GitHub action with package labeling rules
priethor 831987b
Upgrade to v6, update new packages
priethor dc4d694
Fix event name
priethor 095b7c5
Pin action version to commit hash and ubuntu version
priethor 26b9a5f
Remove write permissions for issues
priethor bd45d81
Reduce triggers
priethor 7808af3
Remove soon-to-be-deprecated packages
priethor 53e34f9
Remove `workflow_dispatch`
priethor e6e8494
Disable permissions at root level
priethor 2b895e3
Fix plural labels
priethor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,253 @@ | ||
| # Package labeling rules - only labels that exist on GitHub | ||
|
|
||
| '[Package] A11y': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/a11y/**' | ||
|
|
||
| '[Package] API fetch': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/api-fetch/**' | ||
|
|
||
| '[Package] Autop': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/autop/**' | ||
|
|
||
| '[Package] Base styles': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/base-styles/**' | ||
|
|
||
| '[Package] Blob': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/blob/**' | ||
|
|
||
| '[Package] Block editor': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/block-editor/**' | ||
|
|
||
| '[Package] Block library': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/block-library/**' | ||
|
|
||
| '[Package] Blocks': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/blocks/**' | ||
|
|
||
| '[Package] Commands': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/commands/**' | ||
|
|
||
| '[Package] Components': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/components/**' | ||
|
|
||
| '[Package] Compose': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/compose/**' | ||
|
|
||
| '[Package] Core commands': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/core-commands/**' | ||
|
|
||
| '[Package] Core data': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/core-data/**' | ||
|
|
||
| '[Package] Data Controls': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/data-controls/**' | ||
|
|
||
| '[Package] Data': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/data/**' | ||
|
|
||
| '[Package] DataViews': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/dataviews/**' | ||
|
|
||
| '[Package] Date': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/date/**' | ||
|
|
||
| '[Package] Deprecated': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/deprecated/**' | ||
|
|
||
| '[Package] DOM ready': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/dom-ready/**' | ||
|
|
||
| '[Package] DOM': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/dom/**' | ||
|
|
||
| '[Package] E2E Tests': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/e2e-test-utils-playwright/**' | ||
|
|
||
| '[Package] Edit Post': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/edit-post/**' | ||
|
|
||
| '[Package] Edit Site': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/edit-site/**' | ||
|
|
||
| '[Package] Edit Widgets': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/edit-widgets/**' | ||
|
|
||
| '[Package] Editor': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/editor/**' | ||
|
|
||
| '[Package] Element': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/element/**' | ||
|
|
||
| '[Package] Escape HTML': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/escape-html/**' | ||
|
|
||
| '[Package] Fields': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/fields/**' | ||
|
|
||
| '[Package] Format library': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/format-library/**' | ||
|
|
||
| '[Package] Hooks': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/hooks/**' | ||
|
|
||
| '[Package] HTML entities': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/html-entities/**' | ||
|
|
||
| '[Package] i18n': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/i18n/**' | ||
|
|
||
| '[Package] Icons': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/icons/**' | ||
|
|
||
| '[Package] Interactivity': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/interactivity/**' | ||
|
|
||
| '[Package] Interactivity Router': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/interactivity-router/**' | ||
|
|
||
| '[Package] Interface': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/interface/**' | ||
|
|
||
| '[Package] is-shallow-equal': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/is-shallow-equal/**' | ||
|
|
||
| '[Package] Keyboard Shortcuts': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/keyboard-shortcuts/**' | ||
|
|
||
| '[Package] Keycodes': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/keycodes/**' | ||
|
|
||
| '[Package] Lazy import': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/lazy-import/**' | ||
|
|
||
| '[Package] Media Utils': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/media-utils/**' | ||
|
|
||
| '[Package] Notices': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/notices/**' | ||
|
|
||
| '[Package] Patterns': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/patterns/**' | ||
|
|
||
| '[Package] Plugins': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/plugins/**' | ||
|
|
||
| '[Package] Preferences': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/preferences/**' | ||
|
|
||
| '[Package] Primitives': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/primitives/**' | ||
|
|
||
| '[Package] Priority Queue': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/priority-queue/**' | ||
|
|
||
| '[Package] Private APIs': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/private-apis/**' | ||
|
|
||
| '[Package] Project management automation': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/project-management-automation/**' | ||
|
|
||
| '[Package] React i18n': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/react-i18n/**' | ||
|
|
||
| '[Package] Redux Routine': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/redux-routine/**' | ||
|
|
||
| '[Package] Rich text': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/rich-text/**' | ||
|
|
||
| '[Package] Router': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/router/**' | ||
|
|
||
| '[Package] Sanitize': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/sanitize/**' | ||
|
|
||
| '[Package] Server Side Render': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/server-side-render/**' | ||
|
|
||
| '[Package] Style Engine': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/style-engine/**' | ||
|
|
||
| '[Package] Sync': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/sync/**' | ||
|
|
||
| '[Package] Theme': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/theme/**' | ||
|
|
||
| '[Package] Token List': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/token-list/**' | ||
|
|
||
| '[Package] Url': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/url/**' | ||
|
|
||
| '[Package] Viewport': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/viewport/**' | ||
|
|
||
| '[Package] Warning': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/warning/**' | ||
|
|
||
| '[Package] Word count': | ||
| - changed-files: | ||
| - any-glob-to-any-file: 'packages/wordcount/**' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: 'Pull Request Labeler' | ||
| on: | ||
| pull_request_target: | ||
| types: [opened, synchronize] | ||
|
|
||
| # Disable permissions for all available scopes by default. | ||
| # Any needed permissions should be configured at the job level. | ||
| permissions: {} | ||
|
|
||
|
priethor marked this conversation as resolved.
Resolved
|
||
| jobs: | ||
| auto_label_pull_request: | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 | ||
| with: | ||
| dot: true | ||
| sync-labels: true | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to automate this list? Looking quickly, it seems that the part of the label after
[Package]can just be coerced into lowercase and spaces replaced with hyphens to construct the directory path. For example,[Package] API Fetch->packages/api-fetc/**. The only one where this is not the case is the[Package] E2E Tests.We just removed a manually-curated list in #72672, so want to make sure that adding a new file for something similar is the desired solution.
I don't know if this is possible, but what if there was a step prior to this one that queried for all of the active
[Package]labels for the repository and then created this file or a list on the fly each time?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it can be done, there are only a few exceptions like e2e and some typos that can be fixed at the label level.
I'd be happy to attempt that in a follow-up, to get this up and running first and see how it works before investing too much time in that. At the end of the day, label mismatches won't harm PRs as opposed to the Type-label enforcer, which would leave annoying messages and block merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually: