X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c97b9c55b488a478afe171537c0e4c0f10631ca1..882d8795c6ff65c02f2657e596391748d1b6b7f5:/action.yml diff --git a/action.yml b/action.yml index 282fca4..8b698ae 100644 --- a/action.yml +++ b/action.yml @@ -36,10 +36,24 @@ runs: - name: black run: | if [ "$RUNNER_OS" == "Windows" ]; then - python $GITHUB_ACTION_PATH/action/main.py | tee -a $GITHUB_STEP_SUMMARY + runner="python" else - python3 $GITHUB_ACTION_PATH/action/main.py | tee -a $GITHUB_STEP_SUMMARY + 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 }}