Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a389a6

Browse files
committed
ci: add GitHub Actions workflow for automated release notes
1 parent a71005a commit 5a389a6

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Create GitHub Release from Commit Message
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
create-release-notes:
10+
runs-on: ubuntu-latest
11+
if: "startsWith(github.event.head_commit.message, 'chore(release):')"
12+
environment:
13+
name: Release
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Extract version from commit message
20+
id: extract_version
21+
run: |
22+
COMMIT_MSG="${{ github.event.head_commit.message }}"
23+
if [[ "$COMMIT_MSG" =~ chore\(release\):\ v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
24+
VERSION="v${BASH_REMATCH[1]}"
25+
echo "version=$VERSION" >> $GITHUB_OUTPUT
26+
else
27+
exit 1
28+
fi
29+
30+
- name: Create Release
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
tag_name: ${{ steps.extract_version.outputs.version }}
34+
name: ${{ steps.extract_version.outputs.version }}
35+
draft: false
36+
prerelease: false
37+
make_latest: 'true'
38+
token: ${{ secrets.TEMPO_TOKEN }}
39+
body_path: ${{ github.workspace }}/.changes/${{ steps.extract_version.outputs.version }}.md
40+
generate_release_notes: false

0 commit comments

Comments
 (0)