Skip to content

Commit 45a1c26

Browse files
committed
chore: add release type detection and update release notes
1 parent e31fc4c commit 45a1c26

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ jobs:
2626

2727
- name: Set version
2828
id: get-version
29-
run: echo "version=$(grep '^version:' chart/Chart.yaml | awk '{print $2}')" >> "$GITHUB_OUTPUT"
29+
run: |
30+
echo "version=$(grep '^version:' chart/Chart.yaml | awk '{print $2}')" >> "$GITHUB_OUTPUT"
31+
release_type=$(echo "$COMMIT_MSG" | sed -n 's/.*bump \(Beta\|Stable\|LTS\) to.*/\1/p')
32+
echo "release_type=${release_type}" >> "$GITHUB_OUTPUT"
33+
env:
34+
COMMIT_MSG: ${{ github.event.head_commit.message }}
3035

3136
- name: Check tag does not already exist
3237
run: |
@@ -43,6 +48,17 @@ jobs:
4348
github_token: ${{ secrets.GITHUB_TOKEN }}
4449
tag: v${{ steps.get-version.outputs.version }}
4550

51+
- name: Add release type to notes
52+
if: steps.get-version.outputs.release_type != ''
53+
run: |
54+
body=$(gh release view "$TAG" --json body -q '.body')
55+
notes="**Release type: $RELEASE_TYPE**${body:+$'\n\n'$body}"
56+
gh release edit "$TAG" --notes "$notes"
57+
env:
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
TAG: v${{ steps.get-version.outputs.version }}
60+
RELEASE_TYPE: ${{ steps.get-version.outputs.release_type }}
61+
4662
publish-helm-chart:
4763
runs-on: ubuntu-latest
4864
needs: create-release

0 commit comments

Comments
 (0)