Skip to content

Commit cbe5f81

Browse files
Fix YAML syntax: use jq for comment body to avoid multi-line string issues
1 parent 60d6e17 commit cbe5f81

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/build-gaia-eval-image.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,23 @@ jobs:
219219
TRIGGER="${{ github.event_name }}"
220220
fi
221221
222-
# Post comment - using printf to avoid backtick issues in YAML
223-
COMMENT_BODY="## GAIA Image Build Complete ✅
224-
225-
**SDK Version:** [\\\`${SDK_SHA_SHORT}\\\`](https://github.com/OpenHands/software-agent-sdk/commit/${SDK_SHA})
226-
**Base Image:** \\\`${IMAGE_TAG}\\\`
227-
**MCP Image:** \\\`${MCP_IMAGE_TAG}\\\` ⚡ _(MCP server pre-cached)_
228-
**Workflow Run:** [#${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
229-
**Triggered by:** ${TRIGGER}
230-
231-
The MCP-enhanced image includes pre-cached \\\`mcp-server-fetch\\\` to eliminate 1-18 minute startup delays."
232-
222+
# Post comment using jq to properly handle multi-line content
223+
jq -n \
224+
--arg sdk_short "${SDK_SHA_SHORT}" \
225+
--arg sdk_full "${SDK_SHA}" \
226+
--arg image "${IMAGE_TAG}" \
227+
--arg mcp_image "${MCP_IMAGE_TAG}" \
228+
--arg run_id "${{ github.run_id }}" \
229+
--arg server_url "${{ github.server_url }}" \
230+
--arg repo "${{ github.repository }}" \
231+
--arg trigger "${TRIGGER}" \
232+
'{body: "## GAIA Image Build Complete ✅\n\n**SDK Version:** [`\($sdk_short)`](https://github.com/OpenHands/software-agent-sdk/commit/\($sdk_full))\n**Base Image:** `\($image)`\n**MCP Image:** `\($mcp_image)` ⚡ _(MCP server pre-cached)_\n**Workflow Run:** [#\($run_id)](\($server_url)/\($repo)/actions/runs/\($run_id))\n**Triggered by:** \($trigger)\n\nThe MCP-enhanced image includes pre-cached `mcp-server-fetch` to eliminate 1-18 minute startup delays."}' | \
233233
curl -L -X POST \
234234
-H "Accept: application/vnd.github+json" \
235235
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
236236
-H "X-GitHub-Api-Version: 2022-11-28" \
237+
-H "Content-Type: application/json" \
237238
"${{ github.api_url }}/repos/${{ github.repository }}/issues/81/comments" \
238-
-d "$(jq -n --arg body "$COMMENT_BODY" '{body: $body}')"
239+
-d @-
239240
env:
240241
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)