Improve release notes for main releases

This commit is contained in:
Mark McDowall 2024-04-11 16:32:28 -07:00 committed by Mark McDowall
parent 9afe1c4b3f
commit 6b08117d7d
1 changed files with 27 additions and 1 deletions

View File

@ -69,12 +69,38 @@ jobs:
pattern: release_* pattern: release_*
merge-multiple: true merge-multiple: true
- name: Get Previous Release
id: previous-release
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
latest: true
prerelease: ${{ inputs.branch != 'main' }}
- name: Generate Release Notes
id: generate-release-notes
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
result-encoding: string
script: |
const { data } = await github.rest.repos.generateReleaseNotes({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: 'v${{ inputs.version }}',
target_commitish: '${{ github.sha }}',
previous_tag_name: '${{ steps.previous-release.outputs.tag_name }}',
})
return data.body
- name: Create release - name: Create release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
artifacts: _artifacts/Sonarr.* artifacts: _artifacts/Sonarr.*
commit: ${{ github.sha }} commit: ${{ github.sha }}
generateReleaseNotes: true generateReleaseNotes: false
body: ${{ steps.generate-release-notes.outputs.result }}
name: ${{ inputs.version }} name: ${{ inputs.version }}
prerelease: ${{ inputs.branch != 'main' }} prerelease: ${{ inputs.branch != 'main' }}
skipIfReleaseExists: true skipIfReleaseExists: true