Skip to content

Commit

Permalink
fix: handled exit-code of script
Browse files Browse the repository at this point in the history
  • Loading branch information
csalerno-asml committed Oct 5, 2023
1 parent 3f6033c commit 9a11b80
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 9a11b80

Please sign in to comment.