Skip to content

Commit e564caa

Browse files
committed
chore: add validation for Docker Hub credentials in workflow
1 parent 5d61709 commit e564caa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/docker.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ jobs:
4141
- name: Set up Docker Buildx
4242
uses: docker/setup-buildx-action@v3
4343

44+
- name: Validate Docker Hub secrets
45+
run: |
46+
echo "username length: ${#DOCKERHUB_USERNAME}"
47+
echo "token length: ${#DOCKERHUB_TOKEN}"
48+
if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_TOKEN" ]; then
49+
echo "Missing Docker credentials"
50+
exit 1
51+
fi
52+
env:
53+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
54+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
55+
4456
- name: Log in to Docker Hub
4557
uses: docker/login-action@v3
4658
with:

0 commit comments

Comments
 (0)