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.
This commit is contained in:
db123-test
2026-05-04 10:06:00 +03:30
parent 73748a9d09
commit 19753ec07d

View File

@@ -15,16 +15,16 @@ jobs:
run: git clone "${{ secrets.G_CLONE_URL }}" . run: git clone "${{ secrets.G_CLONE_URL }}" .
- name: Set go proxy mirror - 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 - name: Download dependencies
run: go mod download run: /usr/local/go/bin/go mod download
- name: Check formatting - name: Check formatting
run: | 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:" 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 exit 1
fi fi
@@ -37,13 +37,13 @@ jobs:
run: git clone "${{ secrets.G_CLONE_URL }}" . run: git clone "${{ secrets.G_CLONE_URL }}" .
- name: Build for Linux amd64 - 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 - 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 - 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 - name: Package binaries
run: | run: |