action-gh-release
action-gh-release copied to clipboard
Add option to use annotated tag message as release notes
Annotated tags can contain release notes, and it would be nice if this action provided an option to use the tag's message as the GitHub Release notes.
Note: Looks like git tag -l --format="%(contents:body)" <tag name>
gets the tag message.
Until this is implemented a workaround could be to write the contents to a file and use body_path
,
or set the result as an output in a previous step.
I think I finally got the workaround working :weary: This is an example of what I did
name: Release
on:
push:
tags: ['v*.*.*']
jobs:
release-notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get Release Notes
run: 'echo "$(git tag -l --format="%(contents:body)" $GITHUB_REF_NAME)" > RELEASE_NOTES'
- name: Set Release Notes
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_NOTES
Neat trick. Quick heads up this action now supports GitHubs automatically generated release notes
https://github.com/softprops/action-gh-release/blob/58fa4b7a8863f6beaf115a49196308842b8b0f06/action.yml#L43
I would still like to use the tag annotation as release notes xd
@Fuseteam I ended up writing a simple action that uses gh
since I was repeating the same workflow a lot. It doesn't do much except take the subject (first line) of a tag message and make it the release title, and take the body (lines 3 and over) and make it the release body. Feel free to check it out :smiley:
If you need more complicated usage, you can use tag-to-release to create a release and this action to do other stuff like upload assets.
@spenserblack awesome i'll take a look xD
@spenserblack i tried to combine it but it used my commit message as the title and left the body empty xd i think this overwrote it :p
Oh yeah it pretty naively tries to get the latest tag message. It also needs to be checked out at the ref (see the actions/checkout
part of the example). The action actually uses itself, so you can see that as an example.
https://github.com/spenserblack/actions-tag-to-release/blob/d5607a72fb47a8614e1154ca456d5b7eaf0c10ab/.github/workflows/release.yml#L1-L16
If you have any more trouble with it please open an issue on that repo 🙂
Cool thanks~