diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 051ede3..bccbdc9 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -18,6 +18,7 @@ jobs: steps: - uses: actions/checkout@v6 with: + ref: ${{ github.event_name == 'release' && github.event.release.target_commitish || github.ref }} fetch-depth: 0 # full history for tag detection and diff stats - name: Resolve tag @@ -25,8 +26,10 @@ jobs: run: | if [[ "${{ github.event_name }}" == "release" ]]; then echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT" + echo "target_ref=${{ github.event.release.target_commitish }}" >> "$GITHUB_OUTPUT" else echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" + echo "target_ref=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" fi # ── Surface 1: GitHub Release body + step summary ────────── @@ -81,5 +84,5 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add CHANGELOG.md git commit -m "docs: update CHANGELOG for ${{ steps.tag.outputs.tag }}" - git push + git push origin "HEAD:${{ steps.tag.outputs.target_ref }}" fi