Skip to content

Commit 81e3d73

Browse files
committed
make customer deployment test optional when secret missing
- Change fatal error to warning when WG_EASY_CUSTOMER_EMAIL secret is missing - Add conditional execution for customer/cluster creation and helm install test - Allows workflow to complete successfully for basic validation without customer secrets - Enables testing of build, lint, and release steps in environments without full secrets
1 parent 65475bd commit 81e3d73

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/wg-easy-pr-validation.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,26 +189,32 @@ jobs:
189189
working-directory: ${{ env.APP_DIR }}
190190
outputs:
191191
license-id: ${{ steps.license.outputs.license-id }}
192+
skip-customer-test: ${{ steps.prereqs.outputs.skip-customer-test }}
192193

193194
steps:
194195
- name: Checkout code
195196
uses: actions/checkout@v4
196197

197-
- name: Validate prerequisites
198+
- name: Check prerequisites
199+
id: prereqs
198200
run: |
199201
if [ -z "${{ secrets.WG_EASY_CUSTOMER_EMAIL }}" ]; then
200-
echo "::error::WG_EASY_CUSTOMER_EMAIL secret is required"
201-
exit 1
202+
echo "::warning::WG_EASY_CUSTOMER_EMAIL secret not found - skipping customer deployment test"
203+
echo "skip-customer-test=true" >> $GITHUB_OUTPUT
204+
else
205+
echo "skip-customer-test=false" >> $GITHUB_OUTPUT
202206
fi
203207
204208
- name: Setup tools
205209
uses: ./.github/actions/setup-tools
206210

207211
- name: Create customer
212+
if: steps.prereqs.outputs.skip-customer-test == 'false'
208213
run: task customer-create CUSTOMER_NAME="${{ needs.setup.outputs.branch-name }}" RELEASE_CHANNEL="${{ needs.setup.outputs.channel-name }}"
209214
timeout-minutes: 5
210215

211216
- name: Create cluster with retry
217+
if: steps.prereqs.outputs.skip-customer-test == 'false'
212218
uses: nick-fields/[email protected]
213219
with:
214220
timeout_minutes: 20
@@ -219,6 +225,7 @@ jobs:
219225
task cluster-create CLUSTER_NAME="${{ needs.setup.outputs.branch-name }}"
220226
221227
- name: Get customer license ID
228+
if: steps.prereqs.outputs.skip-customer-test == 'false'
222229
id: license
223230
run: |
224231
LICENSE_ID=$(task utils:get-customer-license CUSTOMER_NAME="${{ needs.setup.outputs.branch-name }}" --silent | tail -1)
@@ -228,6 +235,7 @@ jobs:
228235
helm-install-test:
229236
runs-on: ubuntu-22.04
230237
needs: [setup, create-customer-and-cluster]
238+
if: needs.create-customer-and-cluster.outputs.skip-customer-test == 'false'
231239
defaults:
232240
run:
233241
working-directory: ${{ env.APP_DIR }}

0 commit comments

Comments
 (0)