From 62c1ae164f83316e80ea2f193796552efa5eac3f Mon Sep 17 00:00:00 2001 From: Cristiano Salerno <119511125+csalerno-asml@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:50:13 +0200 Subject: [PATCH 1/3] Update output display to job summary --- action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 282fca43dea..0d8c172af67 100644 --- a/action.yml +++ b/action.yml @@ -36,10 +36,14 @@ runs: - name: black run: | if [ "$RUNNER_OS" == "Windows" ]; then - python $GITHUB_ACTION_PATH/action/main.py | tee -a $GITHUB_STEP_SUMMARY + out=$(python $GITHUB_ACTION_PATH/action/main.py) else - python3 $GITHUB_ACTION_PATH/action/main.py | tee -a $GITHUB_STEP_SUMMARY + out=$(python3 $GITHUB_ACTION_PATH/action/main.py) fi + + echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY + echo "${out}" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY env: # TODO: Remove once https://github.com/actions/runner/issues/665 is fixed. INPUT_OPTIONS: ${{ inputs.options }} From ea0de88966ab887b8184b87b3e2395da4ecf0871 Mon Sep 17 00:00:00 2001 From: Cristiano Salerno <119511125+csalerno-asml@users.noreply.github.com> Date: Thu, 5 Oct 2023 07:58:14 +0000 Subject: [PATCH 2/3] fix: handled exit-code of script --- action.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 0d8c172af67..8b698ae3c80 100644 --- a/action.yml +++ b/action.yml @@ -36,14 +36,24 @@ runs: - name: black run: | if [ "$RUNNER_OS" == "Windows" ]; then - out=$(python $GITHUB_ACTION_PATH/action/main.py) + runner="python" else - out=$(python3 $GITHUB_ACTION_PATH/action/main.py) + runner="python3" fi + out=$(${runner} $GITHUB_ACTION_PATH/action/main.py) + exit_code=$? + + # Display the raw output in the step + echo "${out}" + + # Display the Markdown output in the job summary echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY echo "${out}" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + + # Exit with the exit-code returned by Black + exit ${exit_code} env: # TODO: Remove once https://github.com/actions/runner/issues/665 is fixed. INPUT_OPTIONS: ${{ inputs.options }} From 404da7f844c672bd502ec6ce0f5a8a7212663fc8 Mon Sep 17 00:00:00 2001 From: Cristiano Salerno <119511125+csalerno-asml@users.noreply.github.com> Date: Thu, 5 Oct 2023 08:01:16 +0000 Subject: [PATCH 3/3] added changelog message --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 888824ee055..062a195717d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -48,6 +48,8 @@ +- The action output displayed in the job summary is now wrapped in Markdown (#3914) + ### Documentation