Skip to content

Commit ff0000e

Browse files
committed
Ensures presence of ACR secrets before Docker steps
Prevents build and deploy failures by verifying required registry credentials before proceeding with Docker operations.
1 parent 885aac5 commit ff0000e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
2525

26+
- name: Assert required ACR secrets are set
27+
run: |
28+
if [ -z "${{ secrets.ACR_USERNAME }}" ]; then echo "ERROR: secrets.ACR_USERNAME is not set"; exit 1; fi
29+
if [ -z "${{ secrets.ACR_PASSWORD }}" ]; then echo "ERROR: secrets.ACR_PASSWORD is not set"; exit 1; fi
30+
2631
- name: Set up Docker Buildx
2732
uses: docker/setup-buildx-action@v3
2833

.github/workflows/docker-deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212

13+
- name: Assert required ACR secrets are set
14+
run: |
15+
if [ -z "${{ secrets.ACR_LOGIN_SERVER }}" ]; then echo "ERROR: secrets.ACR_LOGIN_SERVER is not set"; exit 1; fi
16+
if [ -z "${{ secrets.ACR_USERNAME }}" ]; then echo "ERROR: secrets.ACR_USERNAME is not set"; exit 1; fi
17+
if [ -z "${{ secrets.ACR_PASSWORD }}" ]; then echo "ERROR: secrets.ACR_PASSWORD is not set"; exit 1; fi
18+
1319
- name: Log in to Azure Container Registry
1420
uses: azure/docker-login@v1
1521
with:

0 commit comments

Comments
 (0)