Skip to content

Commit 77e37bd

Browse files
committed
fix(ci): handle multiline commit message in publish workflow
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
1 parent dc4aade commit 77e37bd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
- name: Check if release commit
1818
id: check
1919
run: |
20-
MSG="${{ github.event.head_commit.message }}"
21-
if echo "$MSG" | grep -qP '^release: v[\d]'; then
22-
VER=$(echo "$MSG" | sed 's/release: v\([^ ]*\).*/\1/')
20+
FIRST_LINE=$(echo "${{ github.event.head_commit.message }}" | head -1)
21+
if echo "$FIRST_LINE" | grep -qP '^release: v[\d]'; then
22+
VER=$(echo "$FIRST_LINE" | sed 's/release: v\([^ ]*\).*/\1/')
2323
echo "is_release=true" >> "$GITHUB_OUTPUT"
2424
echo "version=$VER" >> "$GITHUB_OUTPUT"
2525
echo "Detected release v${VER}"

0 commit comments

Comments
 (0)