Skip to content

v1.2.34

v1.2.34 #62

name: Regenerate release notes
on:
release:
types: [published]
permissions: {}
jobs:
regenerate:
if: github.repository_owner == 'jkroepke'
name: 'regenerate'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Update notes
#language=bash
run: |
TAG="${GITHUB_REF_NAME}"
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" "/repos/${{ github.repository }}/releases/generate-notes" -f "tag_name=${GITHUB_REF_NAME}" | jq -r '.body')
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" "/repos/${{ github.repository }}/releases/tags/${GITHUB_REF_NAME}" | jq -r '.id')
gh api --method PATCH -H "Accept: application/vnd.github+json" "/repos/${{ github.repository }}/releases/${RELEASE_ID}" -f "body=$NEW_NOTES"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}