diff --git a/.github/workflows/protected-safety-review.yml b/.github/workflows/protected-safety-review.yml index 4ccfaafea7..45f0428aa8 100644 --- a/.github/workflows/protected-safety-review.yml +++ b/.github/workflows/protected-safety-review.yml @@ -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 }} @@ -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: diff --git a/tests/test_protected_safety_review.py b/tests/test_protected_safety_review.py index 49e622f32f..893d162c38 100644 --- a/tests/test_protected_safety_review.py +++ b/tests/test_protected_safety_review.py @@ -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