Skip to content

Commit d3b3b78

Browse files
committed
fix(ci): use heredoc delimiter for multi-line commit messages in GITHUB_OUTPUT
Multi-line commit messages (with body/bullet points) broke the release workflows because 'echo "message=$COMMIT_MSG"' passes each line as a separate file command. Lines starting with '- ' trigger 'Invalid format' errors in GitHub Actions. Fix: use heredoc syntax (message<<EOF / EOF) which safely handles multi-line values in $GITHUB_OUTPUT.
1 parent efba4db commit d3b3b78

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/release-beta.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ jobs:
137137
- name: Get latest commit message
138138
id: commit
139139
run: |
140-
COMMIT_MSG=$(git log -1 --pretty=%B)
141-
echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
142-
echo "Commit message: $COMMIT_MSG"
140+
echo "message<<EOF" >> $GITHUB_OUTPUT
141+
git log -1 --pretty=%B >> $GITHUB_OUTPUT
142+
echo "EOF" >> $GITHUB_OUTPUT
143+
echo "Commit message: $(git log -1 --pretty=format:"%s")"
143144
144145
- name: Create beta changeset
145146
run: |

.github/workflows/release-canary.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
id: detect
8181
run: |
8282
BRANCH_NAME="${{ github.ref_name }}"
83-
COMMIT_MSG=$(git log -1 --pretty=%B)
83+
COMMIT_MSG=$(git log -1 --pretty=format:"%s")
8484
8585
echo "Branch: $BRANCH_NAME"
8686
echo "Commit: $COMMIT_MSG"
@@ -142,10 +142,11 @@ jobs:
142142
- name: Get commit info
143143
id: commit
144144
run: |
145-
COMMIT_MSG=$(git log -1 --pretty=%B)
146145
COMMIT_SHA=$(git rev-parse --short HEAD)
147146
148-
echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
147+
echo "message<<EOF" >> $GITHUB_OUTPUT
148+
git log -1 --pretty=%B >> $GITHUB_OUTPUT
149+
echo "EOF" >> $GITHUB_OUTPUT
149150
echo "sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
150151
151152
- name: Create canary changeset

0 commit comments

Comments
 (0)