Copilot commented on code in PR #505:
URL: https://github.com/apache/logging-parent/pull/505#discussion_r3649642264
##########
.github/workflows/verify-reproducibility-reusable.yaml:
##########
@@ -90,15 +96,44 @@ jobs:
restore-keys: |
${{ env.CACHE_KEY }}-${{ runner.os }}-
+ # Contains the exact artifacts deployed by `deploy-snapshot-reusable`.
+ - name: Download reference repository
+ if: inputs.reference-artifact-name
+ uses: actions/download-artifact@v8
+ with:
+ name: ${{ inputs.reference-artifact-name }}
+ path: ${{ runner.temp }}/reference-repository
+
# `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: Verify build reproducibility
shell: bash
+ env:
+ NEXUS_URL: ${{ inputs.nexus-url }}
+ REFERENCE_ARTIFACT_NAME: ${{ inputs.reference-artifact-name }}
run: |
+ REFERENCE_REPO="$NEXUS_URL"
+
+ # Computes the URI of the local repository, if
`reference-artifact-name` was given.
+ if [ -n "$REFERENCE_ARTIFACT_NAME" ]; then
+ TEMP_DIR="$RUNNER_TEMP"
+ # On Windows, convert `D:\a\_temp` to `D:/a/_temp`
+ if command -v cygpath > /dev/null; then
+ TEMP_DIR=$(cygpath -m "$TEMP_DIR")
+ fi
+ # Strip the leading `/`, if present, to form a valid `file:///`
URL on all platforms
+ REFERENCE_REPO="file:///${TEMP_DIR#/}/reference-repository"
+ fi
+
+ # Runs Maven
+ if [ -z "$REFERENCE_REPO" ]; then
+ echo '::error::Either `nexus-url` or `reference-artifact-name`
must be provided.'
+ exit 1
+ fi
Review Comment:
The runtime validation only errors when both inputs are empty, but it does
not enforce the documented requirement that *exactly one* of `nexus-url` and
`reference-artifact-name` is provided. If both are set, the script silently
prefers the downloaded artifact and ignores `nexus-url`, which can hide
misconfiguration and contradicts the workflow interface contract.
--
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]