name: '📋 Update Release Notes' on: release: types: - released - edited jobs: update-notes: runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout Repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: ref: master - name: Extract changelog from build.yaml id: changelog run: | changelog=$(sed -n '/^changelog: |-$/,/^[^ ]/{ /^changelog: |-$/d; /^[^ ]/d; s/^ //; p; }' build.yaml) echo "body<> "$GITHUB_OUTPUT" echo "$changelog" >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" - name: Update release body if: steps.changelog.outputs.body != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG_NAME: ${{ github.event.release.tag_name }} BODY: ${{ steps.changelog.outputs.body }} run: | printf '%s' "$BODY" > "$RUNNER_TEMP/release-notes.md" gh release edit "$TAG_NAME" --notes-file "$RUNNER_TEMP/release-notes.md"