Skip to content

Commit 54323b0

Browse files
authored
ci: Directly check for needed secrets before testing against cloud (temporalio#725)
There are other situations besides running in a fork in which the necessary secrets are not available. For example, PRs opened by dependabot do not seem to have access to the secrets. We now directly check if secrets are present, rather than inferring their presence from other environmental things.
1 parent acb0c91 commit 54323b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/ci.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
- os: ubuntu-arm
1919
runsOn: buildjet-4vcpu-ubuntu-2204-arm
2020
runs-on: ${{ matrix.runsOn || matrix.os }}
21+
env:
22+
# We can't check this directly in the cloud test's `if:` condition below,
23+
# so we have to check it here and report it in an env variable.
24+
HAS_SECRETS: ${{ secrets.TEMPORAL_CLIENT_CERT != '' && secrets.TEMPORAL_CLIENT_KEY != '' }}
2125
steps:
2226
- name: Checkout repository
2327
uses: actions/checkout@v4
@@ -53,8 +57,7 @@ jobs:
5357
git diff --exit-code
5458
5559
- name: Test cloud
56-
# Only supported in non-fork runs, since secrets are not available in forks
57-
if: ${{ matrix.cloudTestTarget && (github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/cli') }}
60+
if: ${{ matrix.cloudTestTarget && env.HAS_SECRETS == 'true' }}
5861
env:
5962
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
6063
TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}

0 commit comments

Comments
 (0)