Skip to content

fix: handle multiline discussion body in GITHUB_OUTPUT (send-to-power-automate)#12

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/fix-github-actions-workflow-again
Draft

fix: handle multiline discussion body in GITHUB_OUTPUT (send-to-power-automate)#12
Copilot wants to merge 1 commit intomainfrom
copilot/fix-github-actions-workflow-again

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 3, 2026

Writing discussion.body directly to $GITHUB_OUTPUT via echo breaks when the body contains newlines — the runner parses each line as key=value and throws Invalid format '' on blank/continuation lines, aborting all downstream steps.

Changes

  • toJSON() for title/body env vars — encodes newlines as \n, keeping values single-line safe for env var expansion
  • Write title/body to temp files instead of $GITHUB_OUTPUT — decoded via jq -r ., bypassing the runner's line-format requirement entirely
  • Build Payload reads from temp filesTITLE=$(cat /tmp/discussion_title.txt) instead of steps.inputs.outputs.title
# Before — breaks on multiline body
echo "body=$EVENT_BODY" >> "$GITHUB_OUTPUT"

# After — safe for any content
EVENT_BODY_JSON: ${{ toJSON(github.event.discussion.body) }}
...
printf '%s' "$EVENT_BODY_JSON" | jq -r . > /tmp/discussion_body.txt

Only label, number, url, author, and created_at (all guaranteed single-line) continue to use $GITHUB_OUTPUT.

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: 65541082228
Job URL: https://github.com/golclinics/discussions/actions/runs/22618815084/job/65541082228


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow send-to-power-automate fix: handle multiline discussion body in GITHUB_OUTPUT (send-to-power-automate) 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