This is an automated email from the ASF dual-hosted git repository. robertlazarski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-rampart.git
commit cb60b2ebe86633d508852b934f8f236a1fa7b693 Author: Robert Lazarski <[email protected]> AuthorDate: Tue Jun 9 14:17:23 2026 -1000 CI: skip snapshot Deploy step when Nexus credentials are absent The Deploy job pushes a SNAPSHOT to repository.apache.org using the NEXUS_USER/NEXUS_PW secrets. When those secrets are not provisioned the upload fails with 401 Unauthorized, turning the whole workflow red even though the build itself succeeded. Expose the credentials as job-level env and guard the Deploy step with `if: env.NEXUS_USER != ''` so it is skipped cleanly when no credentials are configured. Snapshot deploys resume automatically once the secrets are set. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 338a5c97..91c932e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,11 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'apache/axis-axis2-java-rampart' name: Deploy runs-on: ubuntu-24.04 + # Credentials are exposed as job-level env so the Deploy step can both use + # them and skip cleanly (see its `if`) when they are not configured. + env: + NEXUS_USER: ${{ secrets.NEXUS_USER }} + NEXUS_PW: ${{ secrets.NEXUS_PW }} needs: - build - site @@ -101,10 +106,11 @@ jobs: server-id: apache.snapshots.https server-username: NEXUS_USER server-password: NEXUS_PW + # Skip cleanly when Nexus credentials are not configured, so a missing-secret + # environment does not turn the whole workflow red. Snapshot deploys resume + # automatically once NEXUS_USER/NEXUS_PW are provisioned in the repo secrets. - name: Deploy + if: ${{ env.NEXUS_USER != '' }} run: mvn -B -e -Papache-release -Dgpg.skip=true -Dmaven.test.skip=true -Dmaven.compiler.release=${{ env.BASE_JAVA_VERSION }} deploy - env: - NEXUS_USER: ${{ secrets.NEXUS_USER }} - NEXUS_PW: ${{ secrets.NEXUS_PW }} - name: Remove Snapshots run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf
