Skip to content

Commit

Permalink
log output multiline in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mordamax committed Oct 10, 2024
1 parent 6049fe4 commit a1cb739
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,12 @@ jobs:
if [ -f /tmp/cmd/command_output.log ]; then
CMD_OUTPUT=$(cat /tmp/cmd/command_output.log)
echo "cmd_output=$CMD_OUTPUT" >> $GITHUB_OUTPUT
# export to summary to display in the PR
echo "$CMD_OUTPUT" >> $GITHUB_STEP_SUMMARY
# should be multiline, otherwise it captures the first line only
echo 'cmd_output<<EOF' >> $GITHUB_OUTPUT
echo "$CMD_OUTPUT" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
- name: Upload command output
Expand Down Expand Up @@ -435,6 +439,7 @@ jobs:
let runUrl = ${{ steps.build-link.outputs.run_url }}
let subweight = process.env.SUBWEIGHT;
let cmdOutput = process.env.CMD_OUTPUT;
console.log(cmdOutput);
let subweightCollapsed = subweight.trim() !== ''
? `<details>\n\n<summary>Subweight results:</summary>\n\n${subweight}\n\n</details>`
Expand Down

0 comments on commit a1cb739

Please sign in to comment.