Copilot commented on code in PR #198:
URL: 
https://github.com/apache/cloudstack-cloudmonkey/pull/198#discussion_r2447190384


##########
.github/workflows/rat.yaml:
##########
@@ -42,12 +42,12 @@ jobs:
 
       - name: Download Apache RAT
         run: |
-          curl -L -O 
https://downloads.apache.org/creadur/apache-rat-0.16.1/apache-rat-0.16.1-bin.tar.gz
-          tar -xzf apache-rat-0.16.1-bin.tar.gz
+          curl -L -O 
https://downloads.apache.org/creadur/apache-rat-0.17/apache-rat-0.17-bin.tar.gz
+          tar -xzf apache-rat-0.17-bin.tar.gz
 
       - name: Run RAT
         run: |
-          java -jar apache-rat-0.16.1/apache-rat-0.16.1.jar -d . -E 
.rat-excludes > rat-report.txt
+          java -jar apache-rat-0.17/apache-rat-0.17.jar -d . -E .rat-excludes 
> rat-report.txt
           cat rat-report.txt
           # Fail if unapproved licenses are found
-          grep -qe '^0 Unknown Licenses' rat-report.txt && exit 0 || exit 1
+          grep -qe '^\s*Unapproved:\s*0\s*A count of unapproved licenses.$' 
rat-report.txt && exit 0 || exit 1

Review Comment:
   The grep pattern appears overly specific by including the descriptive text 
'A count of unapproved licenses.' This makes the check brittle to minor output 
format changes. Consider matching just the essential part: `grep -qe 
'^\s*Unapproved:\s*0\s*'` to improve maintainability while still ensuring zero 
unapproved licenses.
   ```suggestion
             grep -qe '^\s*Unapproved:\s*0\s*' rat-report.txt && exit 0 || exit 
1
   ```



-- 
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]

Reply via email to