From 19009dad35b75aa155c6200813f2af8dcdd805c5 Mon Sep 17 00:00:00 2001 From: CoreOS Bot Date: Mon, 16 Mar 2026 15:20:08 +0000 Subject: [PATCH] =?UTF-8?q?Sync=20repo=20templates=20=E2=9A=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sync with coreos/repo-templates@31f11ace7570717972c88857fbc374fe0d236409. --- .github/workflows/go.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f53c151..9cbeb3c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,11 +24,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.x - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Install Go dependencies run: go get golang.org/x/tools/cmd/cover - name: Check modules @@ -37,8 +37,18 @@ jobs: run: ./build - name: Test run: SUDO_PERMITTED=1 ./test + - name: Check Go formatting (gofmt) + shell: bash + run: | + GO_FILES=$(find . -name '*.go' -not -path "./vendor/*") + UNFORMATTED_FILES=$(gofmt -l $GO_FILES) + if [ -n "$UNFORMATTED_FILES" ]; then + echo "Go files are not formatted. Please run 'gofmt -w .' on your code." + gofmt -d $UNFORMATTED_FILES + exit 1 + fi + echo "All Go files are correctly formatted." - name: Run linter - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v8 with: - version: v1.61.0 - args: -E=gofmt --timeout=30m0s + version: v2.11.3