Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# The release notes are GitHub's generated notes, as on releases made by
# hand with "Generate release notes": every merged PR "by @author" and a
# "New Contributors" section, so contributors whose PR is merged get
# credited. semantic-release's own notes come from git commits, which
# carry no GitHub usernames; they remain in the release commit message.
- name: Use GitHub's generated release notes
if: steps.semantic.outputs.new_release_published == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.semantic.outputs.new_release_git_tag }}
PREVIOUS_TAG: ${{ steps.semantic.outputs.last_release_git_tag }}
run: |
args=(-f "tag_name=$TAG")
if [ -n "$PREVIOUS_TAG" ]; then
args+=(-f "previous_tag_name=$PREVIOUS_TAG")
fi
gh api "repos/$GITHUB_REPOSITORY/releases/generate-notes" "${args[@]}" --jq .body > "$RUNNER_TEMP/notes.md"
gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes-file "$RUNNER_TEMP/notes.md"

# The version to publish: the one semantic-release just cut, or the pushed
# tag without its leading v. Skipped when there is nothing to publish.
version:
Expand Down
Loading