Skip to content

Commit

Permalink
feature/IVYPORTAL-16678-SPIKE-Setup-Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
nhthinh-axonivy committed Jan 10, 2025
1 parent 575275a commit 5392564
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_JAVA: true
VALIDATE_JAVASCRIPT: true
VALIDATE_JSON: true
VALIDATE_YAML: true
VALIDATE_XML: true
VALIDATE_CSS: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_DOCKERFILE: true
LOG_LEVEL: INFO
LOG_FILE: super-linter.log
REPORT_OUTPUT: true
Expand Down Expand Up @@ -104,7 +97,9 @@ jobs:
DETAILS=$(echo "$line" | sed -n 's/.*errors:\([^|]*\).*/\1/p' || echo "No details")
echo "| $LINTER | $STATUS | $DETAILS |" >> /tmp/lint-results/summary.md
fi
echo "$line" >> /tmp/lint-results/linter.log
if echo "$line" | grep -q "ERROR\|WARNING"; then
echo "$line" >> /tmp/lint-results/linter-issues.log
fi
done < "$LOG_FILE"
else
echo "No linter log file found"
Expand All @@ -122,18 +117,19 @@ jobs:
path: |
/tmp/lint-results/linter.log
/tmp/lint-results/summary.md
/tmp/lint-results/linter-issues.log
retention-days: 1

- name: Generate Summary
if: always()
run: |
if [ -f "/tmp/lint-results/summary.md" ]; then
cat /tmp/lint-results/summary.md > $GITHUB_STEP_SUMMARY
if [ -f "/tmp/lint-results/linter.log" ]; then
if [ -f "/tmp/lint-results/linter-issues.log" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Detailed Errors" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/lint-results/linter.log >> $GITHUB_STEP_SUMMARY || echo "No errors found"
cat /tmp/lint-results/linter-issues.log >> $GITHUB_STEP_SUMMARY || echo "No errors found"
echo '```' >> $GITHUB_STEP_SUMMARY
fi
else
Expand All @@ -143,6 +139,6 @@ jobs:
- name: Check Linter Status
if: always()
run: |
if [ -f "/tmp/lint-results/linter.log" ] && grep -E "ERROR" /tmp/lint-results/linter.log > /dev/null; then
if [ -f "/tmp/lint-results/linter-issues.log" ] && grep -E "ERROR" /tmp/lint-results/linter-issues.log > /dev/null; then
exit 1
fi

0 comments on commit 5392564

Please sign in to comment.