From 82741b248dd4474dca638e120e4ab02419bee0e6 Mon Sep 17 00:00:00 2001 From: "Kipchumba C. Bett" Date: Tue, 2 Jul 2024 10:39:32 +0300 Subject: [PATCH] KH-520: Fix failing builds on PR from forked repositories --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed68fc55..0f4a9b95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,10 @@ jobs: with: java-version: "8" maven-phase: "install" - maven-args: "-P prod" # Remove -Pvalidator to temporarily bypass validation - use-secrets: true + maven-args: + ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' ? '-P prod -DskipTests': '' }} + use-secrets: + ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' ? true: false }} secrets: NEXUS_USERNAME: ${{ secrets.MEKOM_NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.MEKOM_NEXUS_PASSWORD }} @@ -24,7 +26,7 @@ jobs: uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main with: java-version: "8" - maven-args: "-P prod -DskipTests=true" + maven-args: "-P prod -DskipTests" secrets: NEXUS_USERNAME: ${{ secrets.MEKOM_NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.MEKOM_NEXUS_PASSWORD }}