Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup Codeql workflow #7614

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -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}}"
2 changes: 1 addition & 1 deletion pkg/plugin/framework/common/server_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

stackTrace.Frames = append(stackTrace.Frames, &proto.StackFrame{
File: location.File,
Line: int32(location.Line),
Line: location.Line,

Check warning on line 75 in pkg/plugin/framework/common/server_errors.go

View check run for this annotation

Codecov / codecov/patch

pkg/plugin/framework/common/server_errors.go#L75

Added line #L75 was not covered by tests
Function: location.Function,
})
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/util/logging/error_location_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -101,15 +101,15 @@ 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
}

return LocationInfo{
File: fileAndLine[0],
Function: functionName,
Line: line,
Line: int32(line),
}
}

Expand Down
2 changes: 1 addition & 1 deletion site/layouts/docs/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3>{{ .title }}</h3>
{{ range .subfolderitems }}
<li>
{{ if .github }}
<a href="{{ $gh }}{{ .url }}" target="_blank">{{ .page }}</a>
<a href="{{ $gh }}{{ .url }}" target="_blank" rel="noopener noreferrer">{{ .page }}</a>
{{ else }}
<a href="/docs/{{ $version }}{{ .url }}">{{ .page }}</a>
{{ end }}
Expand Down
Loading