Skip to content

Commit 88b8363

Browse files
committed
chore(ci): fix "curl: Argument list too long"
1 parent bc7f937 commit 88b8363

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/std.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,17 @@ jobs:
263263
| jq -r --arg commentMarker "$COMMENT_MARKER" 'first(.[] | select(.body | contains($commentMarker)) | .id)'
264264
)
265265
if [ -z "$existingCommentId" ]; then
266-
gh pr comment "$prNumber" --body "$(cat pr-comment.md) <!-- $COMMENT_MARKER -->"
266+
( cat pr-comment.md && echo "<!-- $COMMENT_MARKER -->" ; ) >gh-pr-comment-data.md
267+
gh pr comment "$prNumber" --body-file gh-pr-comment-data.md
267268
else
269+
jq --null-input --rawfile body pr-comment.md --arg marker "<!-- $COMMENT_MARKER -->" '{body: ($body + $marker)}' >curl-patch-data.json
268270
curl --fail-with-body -sSL \
269271
-X PATCH \
270272
-H "Authorization: Bearer $GH_TOKEN" \
271273
-H "Accept: application/vnd.github+json" \
272274
-H "X-GitHub-Api-Version: 2022-11-28" \
273275
"https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/comments/${existingCommentId}" \
274-
-d "$(jq --null-input --arg body "$(cat pr-comment.md) <!-- $COMMENT_MARKER -->" '{body: $body}')"
276+
-d @curl-patch-data.json
275277
fi
276278
277279

0 commit comments

Comments
 (0)