Repository navigation
Build the changelog from the type of each pull request #75
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
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,27 @@ | ||
| # Configuration for GitHub's automatically generated release notes, the changelog of each release. | ||
| # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes | ||
| # Every pull request carries one of these labels, or `skip-changelog` (see workflows/pr-label-check.yml). | ||
|
|
||
| changelog: | ||
| exclude: | ||
| labels: | ||
| - skip-changelog | ||
| authors: | ||
| - dependabot | ||
| - copilot | ||
| categories: | ||
| - title: ⚠️ Breaking Changes | ||
| labels: | ||
| - 'breaking change' | ||
| - title: 🚀 Features | ||
| labels: | ||
| - 'Type/New Feature' | ||
| - title: ✨ Improvements | ||
| labels: | ||
| - 'Type/Improvement' | ||
| - title: 🐛 Bug Fixes | ||
| labels: | ||
| - 'Type/Bug' | ||
| - title: 📝 Other Changes | ||
| labels: | ||
| - '*' |
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
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,53 @@ | ||
| # Requires every pull request to carry a label that says how it goes into the release notes. | ||
| # The `Type/*` labels pick the section of the generated changelog (.github/release.yml), and | ||
| # `skip-changelog` leaves the pull request out of it. Mirrors the check in thunder-id/thunderid. | ||
| # | ||
| # Uses: | ||
| # OS: ubuntu-latest | ||
|
|
||
| name: "🔎 PR Check" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize, labeled, unlabeled, ready_for_review] | ||
| merge_group: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check-labels: | ||
| name: "🏷️ Check PR Labels" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Skip label check for merge queue | ||
| if: github.event_name == 'merge_group' | ||
| run: echo "Skipping label check for merge queue." | ||
|
|
||
| - name: Check for required PR labels | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | ||
| with: | ||
| script: | | ||
| const requiredLabels = [ | ||
| 'Type/New Feature', | ||
| 'Type/Improvement', | ||
| 'Type/Bug', | ||
| 'skip-changelog', | ||
| ]; | ||
|
|
||
| const pr = context.payload.pull_request; | ||
| if (!pr) { | ||
| core.setFailed('Could not find the pull request in the event payload.'); | ||
| return; | ||
| } | ||
|
|
||
| const prLabels = pr.labels.map((l) => l.name); | ||
| if (!prLabels.some((label) => requiredLabels.includes(label))) { | ||
| core.setFailed( | ||
| `PR must have at least one of the following labels: ${requiredLabels.join(', ')}. ` + | ||
| 'The Type/* label picks its section in the release notes; skip-changelog leaves it out.', | ||
| ); | ||
| } else { | ||
| core.info('PR has the required labels.'); | ||
| } |
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
Oops, something went wrong.
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.
Regenerate the changelog after the final rebase.
The changelog notes are generated at line 101 for
v${VERSION}before that tag exists. The release job then runsgit pull --rebaseat line 128 and creates the tag at line 133. A pull request merged toRELEASE_REFafter line 101 is included in the rebased commit and in the new tag. The GitHub release created at line 143 uses that tag, so its notes list the pull request.CHANGELOG.mddoes not list it, so the file and the release notes can differ.Generate the changelog entry after the last rebase and commit it before the tag is created. For example, move the notes generation into the push loop after
git pull --rebase, and amend the release commit when the entry changes. Keep one generation per tag target.