@@ -19,6 +19,23 @@ concurrency:
1919 cancel-in-progress : true
2020
2121jobs :
22+ check-secrets :
23+ name : Check secret availability
24+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
25+ runs-on : ubuntu-24.04
26+ outputs :
27+ has_ecr : ${{ steps.check.outputs.has_ecr }}
28+ steps :
29+ - name : Check if ECR credentials are available
30+ id : check
31+ run : |
32+ if [[ -n "${{ secrets.AWS_ACCESS_KEY_ID }}" && -n "${{ secrets.AWS_ACCOUNT_ID }}" ]]; then
33+ echo "has_ecr=true" >> "$GITHUB_OUTPUT"
34+ else
35+ echo "has_ecr=false" >> "$GITHUB_OUTPUT"
36+ echo "::notice::ECR credentials not available — Docker image builds and dependent tests will be skipped (expected for fork PRs)"
37+ fi
38+
2239 changes :
2340 name : Determine changed packages
2441 if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
6986
7087 build-images :
7188 name : Build Docker images
72- if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
89+ needs :
90+ - check-secrets
91+ if : ${{ needs.check-secrets.outputs.has_ecr == 'true' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft) }}
7392 secrets : inherit
7493 strategy :
7594 fail-fast : false
@@ -193,6 +212,7 @@ jobs:
193212 - changes
194213 - build-js
195214 - build-images
215+ - check-secrets
196216 strategy :
197217 fail-fast : false
198218 matrix :
@@ -211,16 +231,17 @@ jobs:
211231 name : ${{ matrix.name }}
212232 test-pattern : ${{ matrix.test-pattern }}
213233 restore_local_network_data : ${{ matrix.restore_local_network_data }}
214- if : contains(needs.changes.outputs.js-packages, 'dashmate')
234+ if : ${{ needs.check-secrets.outputs.has_ecr == 'true' && contains(needs.changes.outputs.js-packages, 'dashmate') }}
215235
216236 test-suite :
217237 name : Test Suite
218238 needs :
219239 - build-js
220240 - build-images
221241 - changes
242+ - check-secrets
222243 secrets : inherit
223- if : needs.changes.outputs.test-suite == 'true'
244+ if : ${{ needs.check-secrets.outputs.has_ecr == 'true' && needs. changes.outputs.test-suite == 'true' }}
224245 strategy :
225246 fail-fast : false
226247 matrix :
@@ -250,6 +271,7 @@ jobs:
250271 - build-js
251272 - build-images
252273 - changes
274+ - check-secrets
253275 secrets : inherit
254- if : needs.changes.outputs.test-suite == 'true'
276+ if : ${{ needs.check-secrets.outputs.has_ecr == 'true' && needs. changes.outputs.test-suite == 'true' }}
255277 uses : ./.github/workflows/tests-packges-functional.yml
0 commit comments