Skip to content

Commit

Permalink
chore: skip running publishToNexus on forks if NEXUS_* secrets are no…
Browse files Browse the repository at this point in the history
…t set
  • Loading branch information
vlsi committed Jun 8, 2022
1 parent 28c4da1 commit a76991e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/nightlysnapshot.yml
Expand Up @@ -8,9 +8,28 @@ on:
workflow_dispatch:

jobs:
check_secrets:
name: Check if required secrets are available
runs-on: ubuntu-latest
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
outputs:
secrets_available: ${{ steps.set-matrix.outputs.secrets_available }}
steps:
- id: set-matrix
run: |
if [[ -n "${NEXUS_USERNAME:-}" ]] && [[ -n "${NEXUS_PASSWORD:-}" ]]; then
echo "::set-output name=secrets_available::true"
else
echo "::set-output name=secrets_available::false"
fi
snapshot:
name: Snapshot
runs-on: ubuntu-latest
needs: check_secrets
if: ${{ needs.check_secrets.outputs.secrets_available == 'true' }}
env:
ACTIONS_STEP_DEBUG: true
ACTIONS_RUNNER_DEBUG: true
Expand Down

0 comments on commit a76991e

Please sign in to comment.