From 19753ec07d910eb8e731ca9b5bab17e179c9ff7b Mon Sep 17 00:00:00 2001 From: db123-test Date: Mon, 4 May 2026 10:06:00 +0330 Subject: [PATCH] fix(ci): use explicit Go binary paths in CI/CD workflow Update the CI/CD workflow to reference the full path to Go binaries (/usr/local/go/bin/go, gofmt) instead of relying on PATH resolution. This ensures the correct Go version is used when running in the Docker container where the binary location may differ from the default PATH expectation. --- .github/workflows/ci-cd.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 99ee388..9e6a368 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -15,16 +15,16 @@ jobs: run: git clone "${{ secrets.G_CLONE_URL }}" . - name: Set go proxy mirror - run: go env -w GOPROXY=https://go.iranserver.com/repository/go/ && go env -w GOSUMDB=off + run: /usr/local/go/bin/go env -w GOPROXY=https://go.iranserver.com/repository/go/ && /usr/local/go/bin/go env -w GOSUMDB=off - name: Download dependencies - run: go mod download + run: /usr/local/go/bin/go mod download - name: Check formatting run: | - if [ "$(gofmt -l $(find . -name '*.go' -not -path './vendor/*'))" ]; then + if [ "$(/usr/local/go/bin/gofmt -l $(find . -name '*.go' -not -path './vendor/*'))" ]; then echo "Files not properly formatted:" - gofmt -l $(find . -name '*.go' -not -path './vendor/*') + /usr/local/go/bin/gofmt -l $(find . -name '*.go' -not -path './vendor/*') exit 1 fi @@ -37,13 +37,13 @@ jobs: run: git clone "${{ secrets.G_CLONE_URL }}" . - name: Build for Linux amd64 - run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o auth-gate-linux-amd64 . + run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 /usr/local/go/bin/go build -o auth-gate-linux-amd64 . - name: Build for Linux arm64 - run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o auth-gate-linux-arm64 . + run: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 /usr/local/go/bin/go build -o auth-gate-linux-arm64 . - name: Build for Windows amd64 - run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o auth-gate-windows-amd64.exe + run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 /usr/local/go/bin/go build -o auth-gate-windows-amd64.exe - name: Package binaries run: |