Skip to content

Commit d9ce71b

Browse files
authored
Support multi-line message on output (#697)
Additional changes to #696 , because we are handling an output value with multilines.
1 parent fe2ca86 commit d9ce71b

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/Build.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build
22

33
on:
44
workflow_dispatch:
@@ -61,12 +61,6 @@ jobs:
6161
- name: Calculate build variables
6262
id: buildVariables
6363
run: |
64-
LastCommitter=$(git log -1 --pretty=format:%an)
65-
CommitMessage=$(git log -1 --pretty=%B)
66-
67-
echo "LAST_COMMITTER=$LastCommitter" >> $GITHUB_OUTPUT
68-
echo "COMMIT_MESSAGE=$CommitMessage" >> $GITHUB_OUTPUT
69-
7064
currentVersion="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
7165
semVerComponents=( ${currentVersion//-/ } )
7266
semVerComponents=${semVerComponents[0]}
@@ -139,7 +133,18 @@ jobs:
139133
140134
MAVEN_VERSION="$newVersion$versionChangelist"
141135
echo "Full project version: $MAVEN_VERSION"
136+
137+
LastCommitter=$(git log -1 --pretty=format:%an)
138+
CommitMessage=$(git log -1 --pretty=%B)
139+
140+
echo "LAST_COMMITTER=$LastCommitter" >> $GITHUB_OUTPUT
142141
142+
# Handling a multi-line output value
143+
OUTPUT_MESSAGE_EOF="eof${MAVEN_VERSION}"
144+
echo "COMMIT_MESSAGE<<$OUTPUT_MESSAGE_EOF" >> $GITHUB_OUTPUT
145+
echo "$CommitMessage" >> $GITHUB_OUTPUT
146+
echo "$OUTPUT_MESSAGE_EOF" >> $GITHUB_OUTPUT
147+
143148
echo "newVersion=$newVersion" >> $GITHUB_OUTPUT
144149
echo "versionChangelist=$versionChangelist" >> $GITHUB_OUTPUT
145150
echo "MAVEN_VERSION=$MAVEN_VERSION" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)