Skip to content

Commit

Permalink
Merge pull request #19 from V0XNIHILI/patch-1
Browse files Browse the repository at this point in the history
Make sure fail on formatting also happens in pull requests
  • Loading branch information
tgorochowik authored Feb 2, 2024
2 parents e75c887 + 74061d2 commit 21a1f8c
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,22 @@ runs:
-fail-on-error="false" <vvf_git_diff.log || true
fi
if [ "${{ github.event_name }}" == "push" ]; then
if [ "${{ inputs.fail_on_formatting_suggestions }}" == "true" ]; then
if [[ -s "vvf_git_diff.log" || -s "vvf_err.log" ]]; then
echo "Either:"
echo " - Found code non-compliant with formatting rules"
echo "Or:"
echo " - The formatter returned with an error in processing of at least one file"
echo "Marking this workflow run as: FAIL"
echo "Check saved artifacts for more detailed logs."
exit 1
else
echo "Codebase is compliant with formatting rules: SUCCESS"
fi
if [ "${{ inputs.fail_on_formatting_suggestions }}" == "true" ]; then
if [[ -s "vvf_git_diff.log" || -s "vvf_err.log" ]]; then
echo "Either:"
echo " - Found code non-compliant with formatting rules"
echo "Or:"
echo " - The formatter returned with an error in processing of at least one file"
echo "Marking this workflow run as: FAIL"
echo "Check saved artifacts for more detailed logs."
exit 1
else
echo "Checks for files, which are not in current PR: DISABLED"
echo "Codebase is compliant with formatting rules: SUCCESS"
fi
echo "# --- "
else
echo "Checks for files, which are not in current PR: DISABLED"
fi
echo "# --- "
echo "### Run summary ###"
echo "-------------------"
Expand Down

0 comments on commit 21a1f8c

Please sign in to comment.