Skip to content

Commit 2d88401

Browse files
authored
Check for Go before setup (#19)
Signed-off-by: Andy Bavier <andybavier@gmail.com>
1 parent 38673c6 commit 2d88401

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/release-image.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,35 @@ jobs:
2929
env:
3030
DOCKER_TAG: ${{ inputs.docker_tag }}
3131
steps:
32-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@v6
3333

34-
- uses: actions/setup-go@v5
34+
- name: Check for Go project
35+
id: check-go
36+
run: |
37+
if [ -f "go.mod" ]; then
38+
echo "go-project=true" >> $GITHUB_OUTPUT
39+
echo "Go project detected"
40+
else
41+
echo "go-project=false" >> $GITHUB_OUTPUT
42+
echo "No Go project detected"
43+
fi
44+
45+
- name: Setup Go
46+
if: steps.check-go.outputs.go-project == 'true'
47+
uses: actions/setup-go@v6
3548
with:
3649
go-version-file: 'go.mod'
3750
cache: true
3851

3952
- name: Login to Docker Registry
40-
uses: docker/login-action@v3.4.0
53+
uses: docker/login-action@v3
4154
with:
4255
registry: ${{ inputs.docker_registry }}
4356
username: ${{ secrets.DOCKERHUB_USERNAME }}
4457
password: ${{ secrets.DOCKERHUB_PASSWORD }}
4558

4659
- name: Login to GitHub Container Registry
47-
uses: docker/login-action@v3.4.0
60+
uses: docker/login-action@v3
4861
with:
4962
registry: ${{ inputs.github_registry }}
5063
username: ${{ github.actor }}

0 commit comments

Comments
 (0)