-
Notifications
You must be signed in to change notification settings - Fork 133
chore: test self hosted runner #408
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @CarlJi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request appears to be a test or chore related to the setup or functionality of a self-hosted runner, as indicated by its title. The sole code change involves a minor whitespace adjustment in a Go source file, which serves no functional purpose but likely acts as a trigger for the CI/CD pipeline to validate the runner's operation. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CarlJi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a minor formatting change by adding extra blank lines in cmd/profile.go. My review includes a suggestion to remove these unnecessary lines to maintain code cleanliness. The change appears to be for testing purposes as indicated by the title.
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical Security Risk: Self-Hosted Runners + Public RepositoryThis PR migrates workflows to self-hosted runners but introduces critical security vulnerabilities for a public repository. Self-hosted runners executing untrusted code from external PRs create severe risks: Immediate Concerns:
Required Mitigations:
See inline comments for additional issues. |
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
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.
| job_1: | ||
| name: Build goc binary | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted |
There was a problem hiding this comment.
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.
| - uses: actions/setup-go@v3 | ||
| with: | ||
| go-version: '1.17' | ||
| go-version: "1.17" |
There was a problem hiding this comment.
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.
Critical Security IssueSeverity: CRITICAL - This PR introduces a significant security vulnerability by enabling self-hosted runners for all pull requests without access controls. The ProblemSelf-hosted runners executing code from untrusted pull requests can allow arbitrary code execution on your infrastructure. External contributors can:
Recommended SolutionsOption 1 (Recommended): Use GitHub-hosted runners for external PRs: runs-on: ${{ github.event.pull_request.head.repo.full_name == github.repository && 'self-hosted' || 'ubuntu-latest' }}Option 2: Restrict workflows to same-repo PRs only: if: github.event.pull_request.head.repo.full_name == github.repositoryOption 3: Use |
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
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.
Critical Security Concern: Self-Hosted Runners with Pull RequestsThis PR introduces a critical security vulnerability by running workflows triggered by Risk: Attackers can submit malicious PRs to steal credentials, mine cryptocurrency, or pivot to internal systems. GitHub explicitly warns against this configuration. Recommendation: Do not merge until you either:
|
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
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.
| job_1: | ||
| name: Build goc binary | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security & Performance Issues:
-
Security: This workflow runs on
pull_requestevents from untrusted sources. Usingself-hostedallows arbitrary code execution on your infrastructure. -
Performance: Line 58 hardcodes
/home/runner/toolswhich is specific to GitHub-hosted runners. Self-hosted runners may use different paths, causing failures. -
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.
| matrix: | ||
| go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x] | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted |
There was a problem hiding this comment.
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.
| golangci: | ||
| name: lint | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted |
There was a problem hiding this comment.
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.
| # We have generics code, so only 1.18+ can work | ||
| go-version: [1.19.x] | ||
| runs-on: ubuntu-latest | ||
| runs-on: self-hosted |
There was a problem hiding this comment.
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.
No description provided.