-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: new PR changelog template (#5976)
Enables us to auto-generate the changelog from the list of PRs for a modicum of summarizing/categorizing work on PR creation. Does not (yet) allow external contributors to set category labels by themselves as this creates issues with triggering one workflow from another, it is not clear whether they should be allowed to create new categories, and the reviewer/triage team likely is in a better position to do the categorization anyway.
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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,24 @@ | ||
name: Check PR body for changelog convention | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
types: [opened, synchronize, reopened, edited, labeled] | ||
|
||
jobs: | ||
check-pr-body: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PR body | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const { title, body, labels } = context.payload.pull_request; | ||
if (/^(feat|fix):/.test(title) && !labels.some(label => label.name == "changelog-no")) { | ||
if (!labels.some(label => label.name.startsWith("changelog-"))) { | ||
core.setFailed('feat/fix PR must have a `changelog-*` label'); | ||
} | ||
if (!/^This PR [^<]/.test(body)) { | ||
core.setFailed('feat/fix PR must have changelog summary starting with "This PR ..." as first line.'); | ||
} | ||
} |