Skip to content

Commit

Permalink
feat(actions): auto-generate release notes (#1258)
Browse files Browse the repository at this point in the history
Using the `--generate-notes` flag of the `gh release create` command.

Also, the `GITHUB_REF_NAME` environment variable is newly used.
See <https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables>
  • Loading branch information
ybiquitous committed May 10, 2022
1 parent 2df37d7 commit f8e38fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: echo "::set-output name=tag::${GITHUB_REF/refs\/tags\//}"
id: get_tag
- run: gh release create '${{ steps.get_tag.outputs.tag }}' --notes 'See the [changelog](https://github.com/${{ github.repository }}/blob/${{ steps.get_tag.outputs.tag }}/CHANGELOG.md) for more details.'
- run: |
gh release create "${GITHUB_REF_NAME}" \
--generate-notes \
--notes "See the [changelog](https://github.com/${GITHUB_REPOSITORY}/blob/${GITHUB_REF_NAME}/CHANGELOG.md) for more details."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions test/__snapshots__/init.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ jobs:
- run: npm publish
env:
NODE_AUTH_TOKEN: \${{ secrets.NPM_TOKEN }}
- run: echo \\"::set-output name=tag::\${GITHUB_REF/refs\\\\/tags\\\\//}\\"
id: get_tag
- run: gh release create '\${{ steps.get_tag.outputs.tag }}' --notes 'See the [changelog](https://github.com/\${{ github.repository }}/blob/\${{ steps.get_tag.outputs.tag }}/CHANGELOG.md) for more details.'
- run: |
gh release create \\"\${GITHUB_REF_NAME}\\" \\\\
--generate-notes \\\\
--notes \\"See the [changelog](https://github.com/\${GITHUB_REPOSITORY}/blob/\${GITHUB_REF_NAME}/CHANGELOG.md) for more details.\\"
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
"
Expand Down

0 comments on commit f8e38fb

Please sign in to comment.