From 8b09550be6343f90e71d920313fe14a50a67ed87 Mon Sep 17 00:00:00 2001 From: Brandon Stalnaker Date: Wed, 5 Aug 2026 11:25:33 -0400 Subject: [PATCH] Modernize GitHub Actions workflow for current Go toolchain. Replace archived golint (broken under Go 1.18+) with go vet and advisory staticcheck/gofmt checks so CI can build again. --- .github/workflows/go.yml | 47 ++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e2ac720..c126600 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -4,6 +4,13 @@ on: push: pull_request: +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: @@ -11,22 +18,34 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: ^1.13 - id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Get dependencies - run: | - go get -d -v ./events - go get golang.org/x/lint/golint + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + # The module has no external dependencies, so there is nothing to cache. + cache: false - name: Build - run: go build -v ./events + run: go build -v ./... + + - name: Vet + run: go vet ./... - - name: Test - run: golint ./events + - name: Check formatting + continue-on-error: true + run: | + unformatted=$(gofmt -l .) + if [ -n "$unformatted" ]; then + echo "The following files are not gofmt-formatted:" + echo "$unformatted" + exit 1 + fi + + - name: Static analysis + continue-on-error: true + run: | + go install honnef.co/go/tools/cmd/staticcheck@v0.7.0 + staticcheck ./...