Skip to content

Commit

Permalink
feat(CI): Added workflow summary feature to check-format CI
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptarshiSarkar12 committed Jan 4, 2024
1 parent 6243a0c commit d2b328b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ jobs:
id: check
run: mvn spotless:check
continue-on-error: true
- name: Generate Summary
- name: Generate Summary for successful run
if: ${{ steps.check.outcome }} == 'success'
run: |
if [ ${{ steps.check.outcome }} == 'success' ]; then
echo ":ballot_box_with_check: No formatting issues found." >> $GITHUB_STEP_SUMMARY
exit 0
else
echo ":negative_squared_cross_mark: Formatting issues found!" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
gh run view ${{ github.run_id }} --log | grep "ERROR" | sed 's/Check if code needs formatting Check if code aligns with code style [0-9A-Z:.-]\+//' | sed 's/\[ERROR] //' >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
exit 1
fi
echo ":ballot_box_with_check: No formatting issues found." >> $GITHUB_STEP_SUMMARY
- name: Generate Summary for failed run
if: ${{ steps.check.outcome }} != 'success'
run: |
echo ":negative_squared_cross_mark: Formatting issues found!" >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY
gh run view ${{ github.run_id }} --log | grep "ERROR" | sed 's/Check if code needs formatting Check if code aligns with code style [0-9A-Z:.-]\+//' | sed 's/\[ERROR] //' >> $GITHUB_STEP_SUMMARY
echo "```" >> $GITHUB_STEP_SUMMARY

0 comments on commit d2b328b

Please sign in to comment.