Skip to content

Commit a58e390

Browse files
nullvariantclaude
andcommitted
fix(ci): add fork guard to CI-gated approval job
Reject fork PRs from auto-approval by checking workflow_run.head_repository.full_name matches the current repository. Aligns with the existing fork protection posture. Signed-off-by: Null;Variant <null@nullvariant.com> 🖥️ IDE: [VS Code](https://code.visualstudio.com/) 🔌 Extension: [Claude Code](https://claude.ai/download) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Model-Raw: claude-opus-4-6
1 parent 9ae981f commit a58e390

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/justice-bot.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,12 @@ jobs:
292292
ci-gated-approve:
293293
name: 👮 CI-Gated Approval
294294
runs-on: ubuntu-latest
295+
# SECURITY: Reject fork PRs — only same-repo branches are trusted for auto-approval.
295296
if: >
296297
github.event_name == 'workflow_run' &&
297298
github.event.workflow_run.event == 'pull_request' &&
298-
github.event.workflow_run.conclusion == 'success'
299+
github.event.workflow_run.conclusion == 'success' &&
300+
github.event.workflow_run.head_repository.full_name == github.repository
299301
permissions:
300302
contents: read
301303
pull-requests: write

0 commit comments

Comments
 (0)