File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,12 @@ jobs:
2121 - name : Pre-flight secret check
2222 id : secret_check
2323 run : |
24+ # GitHub Actions expressions are evaluated before the shell loop runs, so we cannot
25+ # index into secrets dynamically like secrets[format('{0}', var)]. Instead, check each explicitly.
2426 missing=0
25- for var in AZURE_CLIENT_ID AZURE_TENANT_ID AZURE_SUBSCRIPTION_ID; do
26- if [ -z "${{ secrets[format('{0}', var)] }}" ]; then
27- echo "::error::Required secret $var is missing." >&2
28- missing=1
29- fi
30- done
27+ if [ -z "${{ secrets.AZURE_CLIENT_ID }}" ]; then echo "::error::Required secret AZURE_CLIENT_ID is missing." >&2; missing=1; fi
28+ if [ -z "${{ secrets.AZURE_TENANT_ID }}" ]; then echo "::error::Required secret AZURE_TENANT_ID is missing." >&2; missing=1; fi
29+ if [ -z "${{ secrets.AZURE_SUBSCRIPTION_ID }}" ]; then echo "::error::Required secret AZURE_SUBSCRIPTION_ID is missing." >&2; missing=1; fi
3130 if [ "$missing" -eq 1 ]; then
3231 echo "Missing required secrets. Failing early." >&2
3332 exit 1
You can’t perform that action at this time.
0 commit comments