@@ -8,8 +8,6 @@ const CODEOWNERS = ".github/CODEOWNERS";
88
99type WorkflowStep = {
1010 env ?: Record < string , string > ;
11- id ?: string ;
12- if ?: string ;
1311 name ?: string ;
1412 run ?: string ;
1513 uses ?: string ;
@@ -24,7 +22,6 @@ type WorkflowJob = {
2422} ;
2523
2624type Workflow = {
27- env ?: Record < string , string > ;
2825 jobs ?: Record < string , WorkflowJob > ;
2926 name ?: string ;
3027 permissions ?: Record < string , string > ;
@@ -80,40 +77,16 @@ describe("security-sensitive guard workflow", () => {
8077 const checkout = steps . find ( ( step ) => step . uses ?. startsWith ( "actions/checkout@" ) ) ;
8178
8279 expect ( checkout ?. uses ) . toBe ( "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" ) ;
83- expect ( checkout ?. if ) . toBe ( "steps.rollout.outputs.ready == 'true'" ) ;
8480 expect ( checkout ?. with ?. ref ) . toBe ( "${{ github.workflow_sha }}" ) ;
8581 expect ( checkout ?. with ?. ref ) . not . toBe ( "${{ github.event.pull_request.base.sha }}" ) ;
8682 expect ( checkout ?. with ?. [ "persist-credentials" ] ) . toBe ( false ) ;
8783 expect ( steps . at ( - 1 ) ?. run ) . toBe ( "node scripts/github/security-sensitive-guard.mjs" ) ;
88- expect ( steps . at ( - 1 ) ?. if ) . toBe ( "steps.rollout.outputs.ready == 'true'" ) ;
8984 }
90- } ) ;
91-
92- it ( "temporarily skips PR bases that predate the guard rollout commit" , ( ) => {
93- const parsed = readWorkflow ( ) ;
9485
95- expect ( parsed . env ?. OPENCLAW_SECURITY_SENSITIVE_GUARD_ROLLOUT_SHA ) . toBe (
96- "5d9c010628ea4de3492a12e32f9be5b8c5dfa9ed" ,
97- ) ;
98-
99- const jobs = parsed . jobs ?? { } ;
100- for ( const jobName of [ "security-sensitive-guard-detect" , "security-sensitive-guard" ] ) {
101- const steps = jobs [ jobName ] ?. steps ?? [ ] ;
102- const rollout = steps . find (
103- ( step ) => step . name === "Check security-sensitive guard rollout eligibility" ,
104- ) ;
105-
106- expect ( rollout ?. id ) . toBe ( "rollout" ) ;
107- expect ( rollout ?. env ?. GH_TOKEN ) . toBe ( "${{ github.token }}" ) ;
108- expect ( rollout ?. env ?. PR_BASE_SHA ) . toBe ( "${{ github.event.pull_request.base.sha }}" ) ;
109- expect ( rollout ?. run ) . toContain (
110- "compare/${OPENCLAW_SECURITY_SENSITIVE_GUARD_ROLLOUT_SHA}...${PR_BASE_SHA}" ,
111- ) ;
112- expect ( rollout ?. run ) . toContain ( "ahead|identical)" ) ;
113- expect ( rollout ?. run ) . toContain ( "behind|diverged)" ) ;
114- expect ( rollout ?. run ) . toContain ( "ready=false" ) ;
115- expect ( rollout ?. run ) . toContain ( "predates rollout commit" ) ;
116- }
86+ expect ( workflow ) . not . toContain ( "OPENCLAW_SECURITY_SENSITIVE_GUARD_ROLLOUT_SHA" ) ;
87+ expect ( workflow ) . not . toContain ( "Check security-sensitive guard rollout eligibility" ) ;
88+ expect ( workflow ) . not . toContain ( "steps.rollout.outputs.ready" ) ;
89+ expect ( workflow ) . not . toContain ( "/compare/" ) ;
11790 } ) ;
11891
11992 it ( "keeps detection separate from the final required check" , ( ) => {
0 commit comments