Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/e2e_test_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
job_1:
name: Build goc binary
runs-on: ubuntu-latest
runs-on: self-hosted
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical Security: Running untrusted PR code on self-hosted runners allows attackers to:

  • Execute arbitrary code on your infrastructure
  • Access secrets and environment variables
  • Persist malicious state across builds

Consider restricting self-hosted runners to protected branches only, or implement approval requirements for external PRs.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security & Performance Issues:

  1. Security: This workflow runs on pull_request events from untrusted sources. Using self-hosted allows arbitrary code execution on your infrastructure.

  2. Performance: Line 58 hardcodes /home/runner/tools which is specific to GitHub-hosted runners. Self-hosted runners may use different paths, causing failures.

  3. Concurrency: The matrix strategy (4 Go versions) may queue or compete for resources if you have limited self-hosted runners, potentially increasing CI time 4x.

steps:
- name: Install Go
uses: actions/setup-go@v2
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
strategy:
matrix:
go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Install Go
uses: actions/setup-go@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
runs-on: self-hosted
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security issue: This workflow runs on all pull_request events using self-hosted runners, creating an attack vector for malicious PRs.

steps:
- uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: "1.17"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This quote style change (single to double) is unrelated to the runner migration. Consider reverting formatting changes or moving them to a separate PR to keep changes focused.

- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ on:
# but only for the master branch
push:
paths-ignore:
- '**.md'
- '**.png'
- "**.md"
- "**.png"
pull_request:
paths-ignore:
- '**.md'
- '**.png'
- "**.md"
- "**.png"
jobs:
run:
name: vet and gofmt
strategy:
matrix:
# We have generics code, so only 1.18+ can work
go-version: [1.19.x]
runs-on: ubuntu-latest
runs-on: self-hosted
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security issue: pull_request events on self-hosted runners allow untrusted code execution. This workflow should either use ubuntu-latest or implement pull_request_target with manual approval.

steps:
- name: Install Go
uses: actions/setup-go@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ut_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
runs-on: ubuntu-latest
runs-on: self-hosted
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same security concern: pull_request + self-hosted + matrix strategy allows untrusted code execution on your infrastructure with potential for severe resource contention across 4 concurrent Go versions.

steps:
- name: Install Go
uses: actions/setup-go@v2
Expand Down
3 changes: 3 additions & 0 deletions cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ var (
force bool // --force flag
output string // --output flag
coverFilePatterns []string // --coverfile flag



Comment on lines +100 to +102

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These extra blank lines are unnecessary and should be removed to improve code readability. It's good practice to group related variable declarations without excessive spacing.

Comment on lines +100 to +102
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These blank lines appear to be accidental and should be removed. They violate Go formatting conventions and are unrelated to the PR's purpose.

Comment on lines +100 to +102
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these unnecessary blank lines. This appears to be an accidental formatting change that reduces code consistency.

Comment on lines +100 to +102
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These blank lines (including one with trailing whitespace) should be removed. They don't serve any purpose and are inconsistent with the codebase style. This appears to be an accidental addition unrelated to the PR's purpose.

skipFilePatterns []string // --skipfile flag
)

Expand Down
Loading