Skip to content

Commit 2583175

Browse files
committed
fix(ci): compact labels JSON before writing to GITHUB_OUTPUT
The pretty-printed JSON from toJSON(...) contains newlines, which the file-command protocol for $GITHUB_OUTPUT rejects without a heredoc delimiter. Flatten it with jq -c instead. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 572ffe5 commit 2583175

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/e2e-gate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
set -euo pipefail
3333
if [ "$EVENT_NAME" = "pull_request" ]; then
3434
head_sha="$PR_HEAD_SHA_FROM_EVENT"
35-
labels_json="$PR_LABELS_FROM_EVENT"
35+
labels_json=$(jq -c . <<< "$PR_LABELS_FROM_EVENT")
3636
else
3737
head_sha="$WORKFLOW_RUN_HEAD_SHA"
3838
pr=$(gh api "repos/$GH_REPO/commits/$head_sha/pulls" --jq '.[0] // empty')
@@ -41,7 +41,7 @@ jobs:
4141
echo "skip=true" >> "$GITHUB_OUTPUT"
4242
exit 0
4343
fi
44-
labels_json=$(echo "$pr" | jq -c '[.labels[].name]')
44+
labels_json=$(jq -c '[.labels[].name]' <<< "$pr")
4545
fi
4646
echo "head_sha=$head_sha" >> "$GITHUB_OUTPUT"
4747
echo "labels_json=$labels_json" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)