-
Notifications
You must be signed in to change notification settings - Fork 98
chore: use github tooling to build release notes #710
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| changelog: | ||
| exclude: | ||
| labels: | ||
| - duplicate | ||
| - invalid | ||
| - wontfix | ||
| categories: | ||
| - title: "New Features" | ||
| labels: | ||
| - enhancement | ||
| - title: "Bug Fixes" | ||
| labels: | ||
| - bug | ||
| - title: "Documentation" | ||
| labels: | ||
| - documentation | ||
| - title: "Other Changes" | ||
| labels: | ||
| - "*" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: "Label PR by conventional commit prefix" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize] | ||
|
|
||
| jobs: | ||
| label: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - name: Apply label based on PR title prefix | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const title = context.payload.pull_request.title; | ||
| const labelMap = { | ||
| 'feat': 'enhancement', | ||
| 'fix': 'bug', | ||
| 'docs': 'documentation', | ||
| 'test': 'testing', | ||
| 'perf': 'enhancement', | ||
| 'refactor': 'enhancement', | ||
| 'ci': 'integrations', | ||
| 'chore': null, | ||
| 'build': null, | ||
| 'style': null, | ||
| 'revert': null, | ||
| }; | ||
|
|
||
| const match = title.match(/^(\w+)[\(!\:]/); | ||
| if (!match) return; | ||
|
|
||
| const prefix = match[1]; | ||
| const label = labelMap[prefix]; | ||
| if (!label) return; | ||
|
Comment on lines
+33
to
+37
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To clarify, an early return here just means that the PR doesn't get a label? This will never stop a PR from being opened / processed?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that's correct : no impact to PR creation, it just wouldn't have a label |
||
|
|
||
| await github.rest.issues.addLabels({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.payload.pull_request.number, | ||
| labels: [label], | ||
| }); | ||
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.
Our current mergify rule is contains: fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release. Do we need to do anything special for the
reverttag? I don't see it listed here.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.
PRs that don't have a label would end up in an uncategorized liast at the end... I'll add it with a null entry (similar to chore/build/style)