Skip to content

fix: prevent GITHUB_OUTPUT corruption from multiline discussion body#11

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-github-actions-workflow
Draft

fix: prevent GITHUB_OUTPUT corruption from multiline discussion body#11
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-github-actions-workflow

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 3, 2026

The send-to-power-automate job failed when a labeled discussion had a multiline body. Writing echo "body=$EVENT_BODY" >> "$GITHUB_OUTPUT" produced lines without = separators, causing the runner to error with Invalid format ''.

Changes

sync-discussion-to-ado.ymlResolve Inputs step

  • Wrap title and body with toJSON() in the env block so newlines are encoded as \n before touching the shell
  • Write title/body to temp files via jq -r . instead of appending to $GITHUB_OUTPUT
# Before
EVENT_TITLE: ${{ github.event.discussion.title }}
EVENT_BODY:  ${{ github.event.discussion.body }}
# ...
echo "title=$EVENT_TITLE" >> "$GITHUB_OUTPUT"  # breaks on newlines
echo "body=$EVENT_BODY"   >> "$GITHUB_OUTPUT"

# After
EVENT_TITLE_JSON: ${{ toJSON(github.event.discussion.title) }}
EVENT_BODY_JSON:  ${{ toJSON(github.event.discussion.body) }}
# ...
printf '%s' "$EVENT_TITLE_JSON" | jq -r . > /tmp/discussion_title.txt
printf '%s' "$EVENT_BODY_JSON"  | jq -r . > /tmp/discussion_body.txt

Build Payload step

  • Reads title/body from temp files; passes them to jq via --arg to safely handle any special characters when constructing the JSON payload
Original prompt

Fix the failing GitHub Actions workflow send-to-power-automate
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 65540737402
Job URL: https://github.com/golclinics/discussions/actions/runs/22618815084/job/65540737402


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow send-to-power-automate fix: prevent GITHUB_OUTPUT corruption from multiline discussion body Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants