Copilot commented on code in PR #7421:
URL: https://github.com/apache/incubator-seata/pull/7421#discussion_r2133856188


##########
.github/workflows/build.yml:
##########
@@ -84,6 +84,32 @@ jobs:
                  -Dcheckstyle.skip=false -Dpmd.skip=false -Dlicense.skip=false 
-DredisCaseEnabled=true \
                  -e -B 
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
       # step 6.2
+      - name: "Print PMD Violation XML Details"
+        if: matrix.java == '8' && always()
+        run: |
+          echo "--- Searching for and printing PMD XML reports with violations 
across all modules ---"
+
+          PMD_REPORT_FILES=$(find . -type f -name "pmd.xml" -print)
+
+          FOUND_VIOLATIONS=false
+
+          for report_file in $PMD_REPORT_FILES; do
+            # Check whether the report file contains the <violation> tag
+            if grep -q "<violation" "$report_file"; then
+              FOUND_VIOLATIONS=true
+              echo "--- PMD XML Report with Violations for: $report_file ---"
+              cat "$report_file"
+              echo "--------------------------------------------------------"
+              echo ""
+            fi
+          done
+
+          if [ "$FOUND_VIOLATIONS" = false ]; then

Review Comment:
   Consider ensuring that the comparison for FOUND_VIOLATIONS is robust by 
explicitly quoting the expected value (e.g., "false") to avoid potential issues 
related to whitespace or shell interpretation.
   ```suggestion
             if [ "$FOUND_VIOLATIONS" = "false" ]; then
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to