Merge pull request #5496 from vector-im/langleyd/5491_fix_CI_for_non_vector_repo_prs

Only run job if secrets are available.
This commit is contained in:
David Langley 2022-02-04 09:21:23 +00:00 committed by GitHub
commit 579eec2103
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -13,8 +13,21 @@ env:
MX_GIT_BRANCH: ${{ github.event.pull_request.head.ref }}
jobs:
check-secret:
runs-on: macos-11
outputs:
out-key: ${{ steps.out-key.outputs.defined }}
steps:
- id: out-key
env:
P12_KEY: ${{ secrets.ALPHA_CERTIFICATES_P12 }}
P12_PASSWORD_KEY: ${{ secrets.ALPHA_CERTIFICATES_P12 }}
if: "${{ env.P12_KEY != '' || env.P12_PASSWORD_KEY != '' }}"
run: echo "::set-output name=defined::true"
build:
if: github.repository == 'vector-im/element-ios'
# Run job if secrets are avilable (not avaiable for forks).
needs: [check-secret]
if: needs.check-secret.outputs.out-key == 'true'
name: Release
runs-on: macos-11

View file

@ -0,0 +1 @@
Fix CI builds for external contributors using forked repos.