Skip to content

Commit 3b17c2e

Browse files
committed
Fix Docker workflow test step and add latest tag for feature branch
- Update test step to use dynamic tag instead of hardcoded :latest - Add :latest tag for feat/use-docker-pre-commit branch to match hook expectations
1 parent 6619cf1 commit 3b17c2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/docker-tools-image.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
type=ref,event=pr
4444
type=sha
4545
type=raw,value=latest,enable={{is_default_branch}}
46+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/feat/use-docker-pre-commit' }}
4647
4748
- name: Build and push Docker image
4849
uses: docker/build-push-action@v5
@@ -55,6 +56,9 @@ jobs:
5556

5657
- name: Test Docker image
5758
run: |
58-
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest terraform --version
59-
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest terraform-docs --version
60-
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest tflint --version
59+
# Use the first tag from the metadata output (branch-specific tag)
60+
IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | head -n1)
61+
echo "Testing image: $IMAGE_TAG"
62+
docker run --rm $IMAGE_TAG terraform --version
63+
docker run --rm $IMAGE_TAG terraform-docs --version
64+
docker run --rm $IMAGE_TAG tflint --version

0 commit comments

Comments
 (0)