Skip to content

Commit 9fe5bfd

Browse files
committed
re-added dockerhub verification
1 parent ddd04da commit 9fe5bfd

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/cicd-to-dockerhub.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,29 @@ jobs:
3232

3333
- name: Image digest
3434
run: echo ${{ steps.docker_build.outputs.digest }}
35+
36+
- name: Verify pushed image
37+
run: |
38+
# Wait a moment for the image to be available
39+
sleep 5
40+
41+
# Pull the image we just pushed
42+
docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/feroxbuster:latest
43+
44+
# Get the digest of the pulled image
45+
PULLED_DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ${{ secrets.DOCKER_HUB_USERNAME }}/feroxbuster:latest | cut -d'@' -f2)
46+
PUSHED_DIGEST="${{ steps.docker_build.outputs.digest }}"
47+
48+
echo "Pushed digest: $PUSHED_DIGEST"
49+
echo "Pulled digest: $PULLED_DIGEST"
50+
51+
# Verify they match
52+
if [ "$PULLED_DIGEST" = "$PUSHED_DIGEST" ]; then
53+
echo "✓ Verification successful: Pulled image matches pushed image"
54+
55+
# Test that the binary works
56+
docker run --rm ${{ secrets.DOCKER_HUB_USERNAME }}/feroxbuster:latest --version
57+
else
58+
echo "✗ Verification failed: Digests do not match"
59+
exit 1
60+
fi

0 commit comments

Comments
 (0)