Release note generation belongs in .github/workflows/release.yml inside the create-release job, after Download artifacts and before Create Release publishes the GitHub Release.
That placement keeps the existing build matrix and artifact uploads untouched while ensuring release-note markdown is ready before publishing.
The job now also performs a full repository checkout before generation so the script can inspect git tags and commit history.
create-releasekeepspermissions.contents: writeso the finalsoftprops/action-gh-releasestep can publish the GitHub Release.- The generator reads local git history and tags from the checked-out repository, and CI enables GitHub API lookup so release notes can prefer merged PR metadata over raw commit titles.
actions/checkout@v4must usefetch-depth: 0increate-releaseso previous-tag resolution can inspect full tag ancestry instead of a shallow clone.
The workflow now invokes scripts/generate_release_notes.py with these inputs:
current_tag: resolved from the pushed tag name, or from the requiredworkflow_dispatchversioninput for manual runsprevious_tag: currently an empty workflow placeholder; when omitted on the CLI, the script auto-resolves the previous reachable release tag from git historyoutput_file: a temporary markdown path on the runner ($RUNNER_TEMP/release-notes.md)repo:.from the checked-out repository rootGITHUB_TOKENandGITHUB_REPOSITORY: provided in CI so the generator can query associated merged PRs when PR-aware mode is enabled
For workflow_dispatch, the manual version input is required. The workflow should fail fast instead of silently treating a branch name as a release tag. If the workflow is manually run against an actual tag ref, the version input must match that tag.
The current CI command shape is:
python3 scripts/generate_release_notes.py \
--current-tag "$current_tag" \
--output "$output_file" \
--repo .CI also enables PR-aware mode with:
RELEASE_NOTES_USE_GITHUB_API=1
GITHUB_TOKEN=$GITHUB_TOKEN
GITHUB_REPOSITORY=$GITHUB_REPOSITORYIf a future workflow step resolves previous_tag explicitly, CI can append:
--previous-tag "$previous_tag"The generator writes markdown to output_file.
The Create Release step now consumes that file with body_path, so softprops/action-gh-release publishes generated release notes together with the existing binary artifacts.
Because body_path is used on each run, rerunning the workflow for an existing release will replace the release body with the newly generated markdown rather than preserving any manual edits made on GitHub.
The current expected markdown shape is the script skeleton:
## Highlights
## Improvements
## Fixes
## Docs & Maintenance- Tag pushes (
refs/tags/v*) still create GitHub Releases. - Manual
workflow_dispatchruns now execute release-note generation, but they still do not publish a GitHub Release unless the workflow is running on an actual tag ref. When run on a tag ref, the manualversioninput must match that ref.
- Build and artifact behavior remains unchanged.
- CI wires the generator into the release job and passes its markdown to the GitHub release action through
body_path. - The script auto-resolves
previous_tagfrom reachable release tags when the workflow does not provide one explicitly. - Local runs work without GitHub API access; CI enables PR-aware note generation so merged PR metadata can be preferred over commit fallback output.