Skip to content

Commit 9d290bd

Browse files
gkalpakalxhub
authored andcommitted
ci: correctly handle commit message with carriage returns in payload-size.sh (angular#43569)
Previously, if a commit message contained a carriage return in its header, the `payload-size.sh` script would fail to upload the payload size data to Firebase, because the JSON payload would be messed up when trying to concatenate the commit message headers. See an example [here][1]. This commit avoids this problem by replacing carriage returns before concatenating the commit message headers with the JSON payload string. [1]: https://app.circleci.com/pipelines/github/angular/angular/37437/workflows/d0fa4adf-43bb-464e-a2fd-d87da15226dd PR Close angular#43569
1 parent d02c8da commit 9d290bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/ci/payload-size.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ addMessage() {
9696
# because $CI_COMMIT_RANGE may contain the previous SHA which will not be in the
9797
# force push or commit, hence we default to last commit.
9898
message=$(git --git-dir ${PROJECT_ROOT}/.git log --oneline $commitRange -- || git --git-dir ${PROJECT_ROOT}/.git log --oneline -n1)
99-
message=$(echo $message | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')
99+
message=$(echo $message | sed 's/\r//g' | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')
100100
payloadData="$payloadData\"message\": \"$message\", "
101101
}
102102

0 commit comments

Comments
 (0)