-
-
Notifications
You must be signed in to change notification settings - Fork 8
33 lines (28 loc) · 832 Bytes
/
release-notes.yml
File metadata and controls
33 lines (28 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Generate Release Notes
on:
release:
types: [published]
jobs:
update-release-notes:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract changelog section
id: changelog
run: |
VERSION=${GITHUB_REF#refs/tags/v}
# Extract the changelog section for this version
awk "/^## \[${VERSION}\]/,/^## \[/" CHANGELOG.md | sed '$d' > release_notes.md
echo "notes<<EOF" >> $GITHUB_OUTPUT
cat release_notes.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Update Release
uses: softprops/action-gh-release@v1
with:
body_path: release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}