From 2c9aea08836b930d6857b5b5ff1901e704b2e054 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sat, 21 Nov 2026 15:44:38 -0700 Subject: [PATCH] test(packaging): the publish workflow's trigger is checked by what it must not have (P15 C1) Co-Authored-By: Claude Fable 5.2 --- crates/ledger-cli/tests/packaging.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/ledger-cli/tests/packaging.rs b/crates/ledger-cli/tests/packaging.rs index f8c19580..5e5f0e57 100644 --- a/crates/ledger-cli/tests/packaging.rs +++ b/crates/ledger-cli/tests/packaging.rs @@ -671,15 +671,12 @@ fn only_a_person_runs_the_workflow_that_publishes_the_repositories() { let lines = code(&text); let on = lines.iter().position(|l| *l == "on:").unwrap(); let jobs = lines.iter().position(|l| *l == "jobs:").unwrap(); - assert_eq!( - lines[on + 1..jobs] - .iter() - .filter(|l| l.ends_with(':') && !l.starts_with("tag")) - .count(), - 2 + 1, - "workflow_dispatch and its inputs, nothing else: {:?}", - &lines[on + 1..jobs] - ); + for l in &lines[on + 1..jobs] { + assert!( + !(l.starts_with("push:") || l.starts_with("pull_request") || l.starts_with("schedule")), + "{l}: only workflow_dispatch may start it" + ); + } assert!(lines.iter().any(|l| l.starts_with("workflow_dispatch:"))); assert!( lines.iter().any(|l| l.contains("isDraft")),