Skip to content

Instantly share code, notes, and snippets.

@davisagli
Created September 7, 2022 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davisagli/9ecec1e48ca5b8c64cee89c6ef545ca6 to your computer and use it in GitHub Desktop.
Save davisagli/9ecec1e48ca5b8c64cee89c6ef545ca6 to your computer and use it in GitHub Desktop.
Github action to preview release notes
name: Preview release notes
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
release-notes:
runs-on: ubuntu-latest
steps:
- run: |
curl -s -X POST \
https://api.github.com/repos/$GITHUB_REPOSITORY/releases/generate-notes \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"tag_name": "${{ github.head_ref || github.ref_name }}", "target_commitish": "main"}' \
| jq -r .body >> $GITHUB_STEP_SUMMARY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment