diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 97fefd1..8ff5d3f 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -18,7 +18,7 @@ jobs: - name: Setup golangci-lint uses: golangci/golangci-lint-action@v9 with: - version: v2.13 + version: v2.13.2 args: --verbose - uses: hadolint/hadolint-action@v3.5.0 @@ -30,7 +30,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - go: ["1.25"] + go: ["1.26", "1.27"] include: - os: ubuntu-latest go-build: ~/.cache/go-build @@ -55,9 +55,9 @@ jobs: path: | ${{ matrix.go-build }} ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go- + ${{ runner.os }}-go-${{ matrix.go }}- - name: Run Tests run: | go test -race -cover -coverprofile=coverage.out ./... diff --git a/CLAUDE.md b/CLAUDE.md index 289e335..22bbab2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -21,7 +21,7 @@ go test -v -run TestName ./... ### Linting ```bash -# Run golangci-lint (requires golangci-lint v2.6) +# Run golangci-lint (requires golangci-lint v2.13) golangci-lint run --verbose # Check Dockerfile @@ -128,7 +128,7 @@ go run . ## Code Style & Standards -- Go version: 1.25 +- Go version: 1.26 - Linter configuration in `.golangci.yml` includes: gosec, govet, staticcheck, errcheck, and formatting tools (gofmt, gofumpt, goimports, golines) - Security scanning via gosec is enabled; intentional security exceptions are marked with `#nosec` comments - All tests should include race detection (`-race` flag) diff --git a/Dockerfile b/Dockerfile index 51cf33f..c09e076 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.25-alpine AS builder +FROM golang:1.26-alpine AS builder # Build arguments for version injection ARG VERSION=dev diff --git a/go.mod b/go.mod index 15ea9bf..c5b9fab 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/appleboy/LLM-action -go 1.25.0 +go 1.26.0 require ( - github.com/appleboy/com v1.2.0 - github.com/sashabaranov/go-openai v1.41.2 + github.com/appleboy/com v1.2.1 + github.com/sashabaranov/go-openai v1.42.1 ) require github.com/yassinebenaid/godump v0.11.1 diff --git a/go.sum b/go.sum index 77269e0..fe3cc94 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ -github.com/appleboy/com v1.2.0 h1:3jyA+yVofe/uzPHHa7Xrsj7rnDy1sZn/8pYHdzHB3GQ= -github.com/appleboy/com v1.2.0/go.mod h1:XK2kV+JWz/gkzsDPotNJL+aS6XCy5GNlbiTWGvIhqIU= -github.com/sashabaranov/go-openai v1.41.2 h1:vfPRBZNMpnqu8ELsclWcAvF19lDNgh1t6TVfFFOPiSM= -github.com/sashabaranov/go-openai v1.41.2/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= +github.com/appleboy/com v1.2.1 h1:4bqaVFSxy1Q3mRotTIcF8TLryTet0652iNDNVV16skM= +github.com/appleboy/com v1.2.1/go.mod h1:KKYavyU5ejOp8c4vW+daKMf6Dw2DxE9IjqmWAhy0huo= +github.com/sashabaranov/go-openai v1.42.1 h1:9nK2UgDVVSIyoEUNDeWqu3Ttj8EqCO6FT8HK0Cv8VEo= +github.com/sashabaranov/go-openai v1.42.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= github.com/yassinebenaid/godump v0.11.1 h1:SPujx/XaYqGDfmNh7JI3dOyCUVrG0bG2duhO3Eh2EhI= github.com/yassinebenaid/godump v0.11.1/go.mod h1:dc/0w8wmg6kVIvNGAzbKH1Oa54dXQx8SNKh4dPRyW44= diff --git a/main.go b/main.go index 493d225..30c5085 100644 --- a/main.go +++ b/main.go @@ -151,7 +151,7 @@ func buildChatRequest( // max_completion_tokens so existing configs keep working. req.MaxCompletionTokens = config.MaxTokens default: - req.MaxTokens = config.MaxTokens + req.MaxTokens = config.MaxTokens //nolint:staticcheck // Preserve max_tokens for compatible services and non-reasoning models. } if isReasoningModel(config.Model) { diff --git a/main_test.go b/main_test.go index 169a1fa..9de1452 100644 --- a/main_test.go +++ b/main_test.go @@ -88,7 +88,8 @@ func TestBuildChatRequest(t *testing.T) { t.Run(tt.name, func(t *testing.T) { req := buildChatRequest(tt.config, messages, nil) - if req.MaxTokens != tt.expectedMaxTokens { + if req.MaxTokens != tt.expectedMaxTokens { //nolint:staticcheck // Verify legacy max_tokens compatibility. + //nolint:staticcheck // Report the legacy field. t.Errorf("MaxTokens = %d, want %d", req.MaxTokens, tt.expectedMaxTokens) } if req.MaxCompletionTokens != tt.expectedMaxCompletionTokens {