Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35611f2

Browse files
authored
test: Ignore github actions jobs that require secrets for external committers (temporalio#414)
1 parent 93138cf commit 35611f2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,28 @@ jobs:
142142

143143
runs-on: ${{ matrix.os }}
144144
needs: compile-binaries
145+
env:
146+
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
147+
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
145148
steps:
146149
# We don't need the core submodule here since bridge since we don't build the project
147150
- uses: actions/checkout@v2
151+
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }}
148152
- uses: actions/setup-node@v1
149153
with:
150154
node-version: ${{ matrix.node }}
155+
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }}
151156
# No need to compile anything, we just need the package ./scripts and their dependencies
152157
- name: Install dependencies without compilation
153158
run: npm ci --ignore-scripts
159+
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }}
154160
- uses: actions/download-artifact@v2
155161
with:
156162
name: packages-${{ matrix.target }}
157163
path: /tmp/registry/storage
164+
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }}
158165
- run: node scripts/init-from-verdaccio.js --registry-dir /tmp/registry --sample https://github.com/temporalio/samples-typescript/tree/next/${{ matrix.sample }}
166+
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }}
159167
- name: Get Temporal docker-compose.yml
160168
run: wget https://raw.githubusercontent.com/temporalio/docker-compose/v1.13.0/docker-compose.yml
161169
if: ${{ matrix.server == 'local' }}
@@ -172,10 +180,7 @@ jobs:
172180
- name: Create certs dir
173181
# We write the certs to disk because it serves the sample
174182
run: node scripts/create-certs-dir.js
175-
env:
176-
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
177-
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
178-
if: ${{ matrix.server == 'cloud' }}
183+
if: ${{ matrix.server == 'cloud' && env.TEMPORAL_CLIENT_CERT != '' }}
179184
- name: Test run a workflow
180185
run: node scripts/test-example.js --work-dir /tmp/registry/example
181186
env:
@@ -186,7 +191,8 @@ jobs:
186191
TEMPORAL_CLIENT_CERT_PATH: /tmp/temporal-certs/client.pem
187192
TEMPORAL_CLIENT_KEY_PATH: /tmp/temporal-certs/client.key
188193
TEMPORAL_TASK_QUEUE: ${{ format('{0}-{1}-{2}', matrix.os, matrix.node, matrix.target) }}
194+
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }}
189195
- run: rm /tmp/temporal-certs/client.pem
190-
if: ${{ matrix.server == 'cloud' }}
196+
if: ${{ matrix.server == 'cloud' && env.TEMPORAL_CLIENT_CERT != '' }}
191197
- run: rm /tmp/temporal-certs/client.key
192-
if: ${{ matrix.server == 'cloud' }}
198+
if: ${{ matrix.server == 'cloud' && env.TEMPORAL_CLIENT_CERT != '' }}

0 commit comments

Comments
 (0)