-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Automatically generate release body
- Loading branch information
1 parent
b56423a
commit ae6a750
Showing
1 changed file
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,37 @@ jobs: | |
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Determine tag" | ||
id: "determine-tag" | ||
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/}\"" | ||
- name: "Determine release tag" | ||
run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV" | ||
|
||
- name: "Determine release body" | ||
uses: "actions/github-script@v5" | ||
with: | ||
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
script: | | ||
const repository = context.repo; | ||
const response = await github.rest.repos.generateReleaseNotes({ | ||
owner: repository.owner, | ||
repo: repository.repo, | ||
tag_name: "${{ env.RELEASE_TAG }}", | ||
}) | ||
core.exportVariable("RELEASE_BODY", response.data.body) | ||
- name: "Create release" | ||
uses: "actions/[email protected]" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
uses: "actions/github-script@v5" | ||
with: | ||
draft: false | ||
prerelease: false | ||
release_name: "${{ steps.determine-tag.outputs.tag }}" | ||
tag_name: "${{ steps.determine-tag.outputs.tag }}" | ||
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
script: | | ||
const repository = context.repo | ||
await github.rest.repos.createRelease({ | ||
body: "${{ env.RELEASE_BODY }}", | ||
draft: false, | ||
name: "${{ env.RELEASE_TAG }}", | ||
owner: repository.owner, | ||
prerelease: false, | ||
repo: repository.repo, | ||
tag_name: "${{ env.RELEASE_TAG }}", | ||
}) |