Fix autolabeler and update release-drafter#78
Conversation
Add an autolabeler workflow and extend release-drafter configuration. Changes: switch name/tag templates to use RESOLVED_VERSION; expand version-resolver labels (include feature/enhancement and bug); embed an autolabeler config section (documentation, chore, refactor, bug, feature rules) in .github/release-drafter.yml; add .github/workflows/autolabeler.yml to automatically label PRs; and simplify .github/workflows/release-drafter.yml triggers/permissions (run on dev and main, add workflow_dispatch, adjust permissions and remove redundant steps/env). These updates enable automatic PR labeling and align release drafting with resolved versions and more granular label rules.
There was a problem hiding this comment.
Code Review
This pull request updates the release-drafter configuration to use $RESOLVED_VERSION for templates and introduces an autolabeler with various category rules. Feedback focuses on correcting several regex patterns in the autolabeler where the optional quantifier was misplaced, potentially causing incorrect matches (e.g., 'chor:' instead of 'chore:'), and recommending a recursive glob pattern for documentation files to ensure they are correctly captured across subdirectories.
| autolabeler: | ||
| - label: "documentation" | ||
| files: | ||
| - "*.md" |
| - '/chore(\/|-).+/' | ||
| - '/dependabot\/.+/' | ||
| title: | ||
| - '/^chore?:/i' |
| branch: | ||
| - '/refactor(\/|-).+/' | ||
| title: | ||
| - '/^refactor?:/i' |
| - '/fix/i' | ||
| - '/^bug?:/i' |
There was a problem hiding this comment.
The regex '/fix/i' is unanchored and will match any title containing the string "fix" (e.g., "Prefix support"), leading to incorrect labeling. Additionally, '/^bug?:/i' matches bu:. It is safer to anchor these to the start of the title and fix the quantifier typo.
- '/^fix(es|ed)?:/i'\n - '/^bugs?:/i'| - '/enhancement(\/|-).+/' | ||
| title: | ||
| - '/^feat(ure)?:/i' | ||
| - '/^enhancement?:/i' |
Add an autolabeler workflow and extend release-drafter configuration.
Changes:
These updates enable automatic PR labeling and align release drafting with resolved versions and more granular label rules.