ci: unify trusted contributor PR automation (#2996)

This commit is contained in:
Carlos Florêncio
2026-08-24 19:11:29 +00:00
committed by GitHub
parent c325169d8d
commit 727d59ce71
20 changed files with 863 additions and 62 deletions
@@ -41,6 +41,7 @@ class ClaudeCodeReviewWorkflowContractTest(unittest.TestCase):
activity_types(workflow, "pull_request_target"),
)
self.assertNotIn(" strip-safe-to-review:", workflow)
self.assertEqual(workflow.count("persist-credentials: false"), 2)
def test_fork_review_uses_only_open_or_safe_to_review_label(self) -> None:
workflow = WORKFLOW.read_text(encoding="utf-8")
@@ -137,7 +138,7 @@ class ClaudeCodeReviewWorkflowContractTest(unittest.TestCase):
"to Claude's allowed_non_write_users input",
)
def test_allowlisted_fork_label_job_adds_both_approval_labels(self) -> None:
def test_allowlisted_fork_label_job_adds_one_approval_label(self) -> None:
workflow = WORKFLOW.read_text(encoding="utf-8")
_, separator, label_job = workflow.partition(" label-allowlisted-fork:")
label_job = label_job.partition("\n claude-review-fork:")[0]
@@ -158,9 +159,10 @@ class ClaudeCodeReviewWorkflowContractTest(unittest.TestCase):
self.assertIn("pull-requests: write", label_job)
self.assertIn("github.rest.issues.addLabels", label_job)
self.assertIn(
"const labels = ['safe-to-review', 'safe-to-test'];",
"const labels = ['safe-to-review'];",
label_job,
)
self.assertNotIn("safe-to-test", label_job)
self.assertNotIn("actions/checkout", label_job)
def test_lint_workflow_runs_preview_contract_test(self) -> None: