Skip to content

security: gate PRT label workflows on same-repository pull_request_ta…#27783

Open
DVHRMNTCBSL wants to merge 1 commit into
google-gemini:mainfrom
DVHRMNTCBSL:security/prt-label-same-repo-guard
Open

security: gate PRT label workflows on same-repository pull_request_ta…#27783
DVHRMNTCBSL wants to merge 1 commit into
google-gemini:mainfrom
DVHRMNTCBSL:security/prt-label-same-repo-guard

Conversation

@DVHRMNTCBSL

Copy link
Copy Markdown

Summary

pr-size-labeler.yml and pr-rate-limiter.yaml run on pull_request_target for external fork PRs and mutate PR labels/comments with GITHUB_TOKEN write access.

This PR adds a same-repository guard so automated PRT label/rate-limit jobs skip external fork PRs. workflow_dispatch is preserved.

Details

Before: Untrusted fork PRs trigger PRT label/rate-limit automation with pull-request write in base repo context.

After: Only same-repo pull_request_target paths run; manual workflow_dispatch unchanged.

Change: Two coordinated if: guards in:

  • .github/workflows/pr-rate-limiter.yaml
  • .github/workflows/pr-size-labeler.yml

No live exploit performed against production. Static analysis / least-privilege hardening aligned with existing eval-pr.yml fork-guard patterns in this repo.

Related

Proactive security hardening for Google OSS Patch Rewards (REPORT-015). Distinct from workflow_run/E2E chain fixes — this targets PRT label automation only.

@DVHRMNTCBSL DVHRMNTCBSL requested a review from a team as a code owner June 10, 2026 05:20
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added the size/xs An extra small PR label Jun 10, 2026
@github-actions

Copy link
Copy Markdown

📊 PR Size: size/XS

  • Lines changed: 8
  • Additions: +8
  • Deletions: -0
  • Files changed: 2

@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs An extra small PR status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant