Context
The actions/release/github composite action creates GitHub releases via
softprops/action-gh-release@v2 with generate_release_notes: true.
The auto-generated notes compare against the wrong previous tag, including
PRs from prior releases.
Example: Release 0.10.0
shows all PRs since 0.8.0 instead of only changes since 0.9.1.
The release notes list 14 PRs when only 3 belong to this release (#170, #172, #175).
Problem / Current Behaviour
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
softprops/action-gh-release calls the GitHub Releases API which auto-detects
the "previous release" to compare against. GitHub picked 0.8.0 instead of
0.9.1, producing a comparison range of 0.8.0...0.10.0 that includes PRs
already released in 0.9.0 and 0.9.1.
The softprops/action-gh-release action does not expose a previous_tag
input, so there's no way to control which tag GitHub compares against.
Affected locations
| File |
Symbol |
Notes |
actions/release/github/action.yml |
Publish GitHub Release step |
generate_release_notes: true |
Proposed Solution
Replace generate_release_notes: true with an explicit body extracted
from the commitizen-generated changelog file. Since commitizen already
generates accurate, scoped release notes during cz bump, we should use
those instead of GitHub's auto-generated notes.
- name: Extract changelog for current release
id: changelog
shell: bash
run: |
VERSION="${{ steps.bump_version.outputs.NEW_VERSION }}"
# Extract the section for this version from the changelog
BODY=$(awk "/^## ${VERSION}/,/^## [0-9]/" "$CHANGELOG_FILE" \
| head -n -1)
echo "body<<CHANGELOG_EOF" >> $GITHUB_OUTPUT
echo "$BODY" >> $GITHUB_OUTPUT
echo "CHANGELOG_EOF" >> $GITHUB_OUTPUT
- uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.body }}
generate_release_notes: false
Alternatively, use gh api directly with the previous_tag_name parameter
which the GitHub Releases API supports but softprops/action-gh-release
does not expose.
Out of Scope
- Fixing existing broken release notes (can be manually edited)
- Changing commitizen's changelog format
Effort Estimate
Size: S
Rationale: replace one step + add changelog extraction step
Definition of Done
Context
The
actions/release/githubcomposite action creates GitHub releases viasoftprops/action-gh-release@v2withgenerate_release_notes: true.The auto-generated notes compare against the wrong previous tag, including
PRs from prior releases.
Example: Release 0.10.0
shows all PRs since
0.8.0instead of only changes since0.9.1.The release notes list 14 PRs when only 3 belong to this release (#170, #172, #175).
Problem / Current Behaviour
softprops/action-gh-releasecalls the GitHub Releases API which auto-detectsthe "previous release" to compare against. GitHub picked
0.8.0instead of0.9.1, producing a comparison range of0.8.0...0.10.0that includes PRsalready released in
0.9.0and0.9.1.The
softprops/action-gh-releaseaction does not expose aprevious_taginput, so there's no way to control which tag GitHub compares against.
Affected locations
actions/release/github/action.ymlPublish GitHub Releasestepgenerate_release_notes: trueProposed Solution
Replace
generate_release_notes: truewith an explicitbodyextractedfrom the commitizen-generated changelog file. Since commitizen already
generates accurate, scoped release notes during
cz bump, we should usethose instead of GitHub's auto-generated notes.
Alternatively, use
gh apidirectly with theprevious_tag_nameparameterwhich the GitHub Releases API supports but
softprops/action-gh-releasedoes not expose.
Out of Scope
Effort Estimate
Size:
SRationale: replace one step + add changelog extraction step
Definition of Done