Skip to content

Commit

Permalink
fix passing check status
Browse files Browse the repository at this point in the history
  • Loading branch information
nl32 committed Oct 3, 2024
1 parent 8fdeb9d commit f555151
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/generateCheck.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
if [ $status == 0 ]; then
echo "## Formatting Check passed 🥳" >>$GITHUB_STEP_SUMMARY
echo "All files are formatted correctly" >>$GITHUB_STEP_SUMMARY
exit 0
if [ $status == 'success' ]; then
echo "## Formatting Check passed 🥳" >>$GITHUB_STEP_SUMMARY
echo "All files are formatted correctly" >>$GITHUB_STEP_SUMMARY
exit 0
else
echo "## Formatting Check Failed 😅" >>$GITHUB_STEP_SUMMARY
echo "Please run prettier using \`npx prettier . --write\` in order to format your code" >>$GITHUB_STEP_SUMMARY
echo "### Files with bad formatting:" >>$GITHUB_STEP_SUMMARY
for file in $files; do
echo "- $file" >>$GITHUB_STEP_SUMMARY
echo "::error file=$file::$file not formatted correctly"
done
exit 1
echo "## Formatting Check Failed 😅" >>$GITHUB_STEP_SUMMARY
echo "Please run prettier using \`npx prettier . --write\` in order to format your code" >>$GITHUB_STEP_SUMMARY
echo "### Files with bad formatting:" >>$GITHUB_STEP_SUMMARY
for file in $files; do
echo "- $file" >>$GITHUB_STEP_SUMMARY
echo "::error file=$file::$file not formatted correctly"
done
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/prettierCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: generate errors/summary
run: .github/workflows/generateCheck.sh
env:
status: ${{ steps.prettier.outcome == 'success' && 0 || 1 }}
status: ${{ steps.prettier.outcome }}

0 comments on commit f555151

Please sign in to comment.