diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..bd5b8cd565 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,38 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + # required for all workflows + security-events: write + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + language: [go] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/pkg/plugin/framework/common/server_errors.go b/pkg/plugin/framework/common/server_errors.go index 7763d4e9ec..16a3fde033 100644 --- a/pkg/plugin/framework/common/server_errors.go +++ b/pkg/plugin/framework/common/server_errors.go @@ -72,7 +72,7 @@ func ErrorStack(err error) *proto.Stack { stackTrace.Frames = append(stackTrace.Frames, &proto.StackFrame{ File: location.File, - Line: int32(location.Line), + Line: location.Line, Function: location.Function, }) } diff --git a/pkg/util/logging/error_location_hook.go b/pkg/util/logging/error_location_hook.go index 5246a8318c..c82562cc24 100644 --- a/pkg/util/logging/error_location_hook.go +++ b/pkg/util/logging/error_location_hook.go @@ -86,7 +86,7 @@ func (h *ErrorLocationHook) Fire(entry *logrus.Entry) error { type LocationInfo struct { File string Function string - Line int + Line int32 } // GetFrameLocationInfo returns the location of a frame. @@ -101,7 +101,7 @@ func GetFrameLocationInfo(frame errors.Frame) LocationInfo { tabIndex := strings.LastIndex(functionNameAndFileAndLine, "\t") fileAndLine := strings.Split(functionNameAndFileAndLine[tabIndex+1:], ":") - line, err := strconv.Atoi(fileAndLine[1]) + line, err := strconv.ParseInt(fileAndLine[1], 10, 32) if err != nil { line = -1 } @@ -109,7 +109,7 @@ func GetFrameLocationInfo(frame errors.Frame) LocationInfo { return LocationInfo{ File: fileAndLine[0], Function: functionName, - Line: line, + Line: int32(line), } } diff --git a/site/layouts/docs/nav.html b/site/layouts/docs/nav.html index 13d26e6be8..1dae83431e 100644 --- a/site/layouts/docs/nav.html +++ b/site/layouts/docs/nav.html @@ -16,7 +16,7 @@

{{ .title }}

{{ range .subfolderitems }}
  • {{ if .github }} - {{ .page }} + {{ .page }} {{ else }} {{ .page }} {{ end }}