From 466e3cc41e701887ace393239e83dab1bcc11775 Mon Sep 17 00:00:00 2001 From: Andy Bavier Date: Wed, 28 Jan 2026 10:38:07 -0700 Subject: [PATCH] Check for Go before setup Signed-off-by: Andy Bavier --- .github/workflows/release-image.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml index 4624cd3..d7405ef 100644 --- a/.github/workflows/release-image.yml +++ b/.github/workflows/release-image.yml @@ -29,22 +29,35 @@ jobs: env: DOCKER_TAG: ${{ inputs.docker_tag }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-go@v5 + - name: Check for Go project + id: check-go + run: | + if [ -f "go.mod" ]; then + echo "go-project=true" >> $GITHUB_OUTPUT + echo "Go project detected" + else + echo "go-project=false" >> $GITHUB_OUTPUT + echo "No Go project detected" + fi + + - name: Setup Go + if: steps.check-go.outputs.go-project == 'true' + uses: actions/setup-go@v6 with: go-version-file: 'go.mod' cache: true - name: Login to Docker Registry - uses: docker/login-action@v3.4.0 + uses: docker/login-action@v3 with: registry: ${{ inputs.docker_registry }} username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Login to GitHub Container Registry - uses: docker/login-action@v3.4.0 + uses: docker/login-action@v3 with: registry: ${{ inputs.github_registry }} username: ${{ github.actor }}