Skip to content
Merged
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
16 changes: 5 additions & 11 deletions .github/workflows/protected-safety-review.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: Protected safety review

# This is deliberately pull_request_target: verifier code and the manifest come
# from the trusted base. The job reads PR metadata/comments over the API and
# never checks out or executes pull-request-head code.
# Manual-only (workflow_dispatch). The automatic PR/comment/merge_group gate
# is disabled; PRs touching workflows or verifier code are gated by unit and
# contract tests, gitleaks, dependency-review, ci, and Merge Queue.
on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, edited]
issue_comment:
types: [created, edited, deleted]
merge_group:
types: [checks_requested]
branches: [main]
workflow_dispatch:

concurrency:
group: protected-safety-review-${{ github.event.pull_request.number || github.event.issue.number || github.event.merge_group.head_sha || github.ref }}
Expand All @@ -25,7 +19,7 @@ permissions:
jobs:
evaluate:
name: Evaluate protected-path evidence
if: github.event_name == 'pull_request_target' || github.event_name == 'merge_group' || github.event.issue.pull_request != null
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand Down
7 changes: 5 additions & 2 deletions tests/test_protected_safety_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,11 @@ def test_workflow_uses_trusted_main_for_merge_group_not_group_content() -> None:
Path(__file__).parents[1] / ".github/workflows/protected-safety-review.yml"
)
text = workflow.read_text(encoding="utf-8")
assert "merge_group:" in text
assert "github.event_name == 'merge_group'" in text
assert "workflow_dispatch:" in text
assert "pull_request_target:" not in text
assert "issue_comment:" not in text
assert "merge_group:" not in text
assert "github.event_name == 'workflow_dispatch'" in text
assert "ref: ${{ github.event.pull_request.base.sha || 'refs/heads/main' }}" in text
assert 'run: echo "sha=$(git rev-parse HEAD)"' in text
assert "TRUSTED_BASE_SHA: ${{ steps.trusted_base.outputs.sha }}" in text
Expand Down
Loading