Skip to content

bug(release): auto-generated release notes use wrong comparison range #3

@MAfarrag

Description

@MAfarrag

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

  • Release notes only contain changes since the previous release
  • Notes sourced from commitizen changelog (single source of truth)
  • Tested with a patch release to verify correct scoping

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions