Skip attestation and deployment steps for fork-based PRs having no access to secrets

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2024-05-19 09:14:46 +02:00
parent 524308314f
commit f88d96a884
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD
1 changed files with 8 additions and 1 deletions

View File

@ -101,6 +101,9 @@ runs:
-
name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
# Skip attestation if ACTIONS_ID_TOKEN_REQUEST_URL env variable is not
# available (e.g., PR originating from a fork)
if: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL != '' }}
with:
subject-path: ${{ inputs.bin_name }}
-
@ -118,7 +121,11 @@ runs:
path: 'api-docs.tar.gz'
-
name: Deploy
if: inputs.event_name != 'pull_request'
# Skip deployment step if:
# - this is a triggered by a PR event (we only push on commit to branch
# events)
# - no SSH key is provided (this is a PR from a fork)
if: inputs.event_name != 'pull_request' && ${{ inputs.SSH_KEY != '' }}
uses: ./.github/actions/deploy
with:
pattern: ${{ inputs.bin_name }}-binary