ppkarwasz commented on code in PR #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321#discussion_r1123772601


##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build 
reproducibility report.
       # For details, see: 
https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1
             fi
           done
+          if [ -n "$failed" ]; then
+            exit $failed
+          fi
 
+      - name: Reports for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@v3

Review Comment:
   IIRC Github produces security alerts if we use the tag of an action instead 
of the SHA1.



##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build 
reproducibility report.
       # For details, see: 
https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1

Review Comment:
   Since [MARTIFACT-35](https://issues.apache.org/jira/browse/MARTIFACT-35) was 
fixed in version 3.4.0, we can also get rid of the `for` loop.



-- 
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: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to