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 ecee9f5 commit 99fe214
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,18 @@ jobs:
java-version: 21
distribution: zulu
- name: Check if code aligns with code style
id: check
run: mvn spotless:check
continue-on-error: true
- name: Generate Summary
run: |
if [ ${{ jobs.check.result }} == '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

0 comments on commit 99fe214

Please sign in to comment.