acoustic-carpenter-78188
07/06/2026, 5:09 PMpull_request_target triggers. Changes address execution context isolation and permission boundaries for untrusted PR code.
What changes were proposed in this pull request?
Security Hardening
• Switched affected workflows from pull_request_target to pull_request (isolates execution)
• Added job-level fork detection guards (gates privileged operations)
• Applied least-privilege permissions (removed unnecessary write tokens)
• Removed explicit fork HEAD checkouts (uses safe merge commit defaults)
Specific Changes
check-generate.yml
• Changed to pull_request trigger
• Moved fork safety logic to setup job
• Removed explicit ref checkouts
build-ci-image.yml
• Changed to pull_request trigger
• Removed pull-requests: write permission
• Added fork detection to push/comment steps
flyte-binary-v2.yml
• Changed to pull_request trigger
• Added v2 branch to push triggers
• Added labeled trigger type support
• Fixed YAML syntax errors
• Added explicit fork detection guard to devbox build job
labeler.yml
• Kept as pull_request_target (safe exception: no code execution)
How was this patch tested?
• Verified workflow syntax and job dependencies
• Tested with internal PRs from base repository—workflows function normally
• Verified fork detection logic blocks privileged operations for external contributors
• Confirmed approval gate requirement in repository settings
Labels
• security: Vulnerability mitigation
Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
Security Notes
Full technical details and threat model documented in private security advisory.
These changes implement defense-in-depth: event isolation + job-level guards + permission least-privilege.
No functional changes for internal contributors. External contributors still receive CI feedback via safe execution paths.
flyteorg/flyteacoustic-carpenter-78188
07/06/2026, 5:09 PMacoustic-carpenter-78188
07/07/2026, 6:20 PM