@@ -16,6 +16,7 @@ function successfulRun(name: string, id: number, updatedAt: string) {
1616 status : "completed" ,
1717 conclusion : "success" ,
1818 head_sha : sha ,
19+ path : ".github/workflows/ci.yml" ,
1920 created_at : "2026-06-17T10:46:24Z" ,
2021 updated_at : updatedAt ,
2122 html_url : `https://github.com/openclaw/openclaw/actions/runs/${ id } ` ,
@@ -79,30 +80,74 @@ describe("verify-pr-hosted-gates", () => {
7980 } ) ;
8081
8182 it ( "accepts the explicit exact-SHA manual CI release gate" , ( ) => {
83+ expect (
84+ collectHostedGateEvidence ( {
85+ sha,
86+ workflowRuns : [
87+ {
88+ ...successfulRun ( `CI release gate ${ sha } ` , 1 , "2026-06-17T10:47:00Z" ) ,
89+ event : "workflow_dispatch" ,
90+ path : ".github/workflows/ci.yml@refs/heads/release-controls" ,
91+ display_title : `CI release gate ${ sha } ` ,
92+ } ,
93+ ] ,
94+ } ) ,
95+ ) . toEqual ( {
96+ headSha : sha ,
97+ workflows : [ expect . objectContaining ( { name : `CI release gate ${ sha } ` , id : 1 } ) ] ,
98+ } ) ;
99+ } ) ;
100+
101+ it ( "prefers the exact release-gate fallback while scheduled CI remains queued" , ( ) => {
82102 expect (
83103 collectHostedGateEvidence ( {
84104 sha,
85105 workflowRuns : [
86106 {
87107 ...successfulRun ( "CI" , 1 , "2026-06-17T10:47:00Z" ) ,
108+ status : "queued" ,
109+ conclusion : null ,
110+ updated_at : "2026-06-17T10:50:00Z" ,
111+ } ,
112+ {
113+ ...successfulRun ( `CI release gate ${ sha } ` , 2 , "2026-06-17T10:49:00Z" ) ,
88114 event : "workflow_dispatch" ,
89115 display_title : `CI release gate ${ sha } ` ,
90116 } ,
91117 ] ,
92118 } ) ,
93119 ) . toEqual ( {
94120 headSha : sha ,
95- workflows : [ expect . objectContaining ( { name : "CI" , id : 1 } ) ] ,
121+ workflows : [ expect . objectContaining ( { name : `CI release gate ${ sha } ` , id : 2 } ) ] ,
96122 } ) ;
97123 } ) ;
98124
125+ it ( "rejects a completed scheduled CI failure even when a fallback passed" , ( ) => {
126+ expect ( ( ) =>
127+ collectHostedGateEvidence ( {
128+ sha,
129+ workflowRuns : [
130+ {
131+ ...successfulRun ( "CI" , 1 , "2026-06-17T10:50:00Z" ) ,
132+ conclusion : "failure" ,
133+ } ,
134+ {
135+ ...successfulRun ( `CI release gate ${ sha } ` , 2 , "2026-06-17T10:49:00Z" ) ,
136+ event : "workflow_dispatch" ,
137+ display_title : `CI release gate ${ sha } ` ,
138+ } ,
139+ ] ,
140+ } ) ,
141+ ) . toThrow ( "Missing successful exact-head CI workflow" ) ;
142+ } ) ;
143+
99144 it ( "rejects an unmarked manual CI run" , ( ) => {
100145 expect ( ( ) =>
101146 collectHostedGateEvidence ( {
102147 sha,
103148 workflowRuns : [
104149 {
105- ...successfulRun ( "CI" , 1 , "2026-06-17T10:47:00Z" ) ,
150+ ...successfulRun ( `CI release gate ${ sha } ` , 1 , "2026-06-17T10:47:00Z" ) ,
106151 event : "workflow_dispatch" ,
107152 display_title : "CI" ,
108153 } ,
@@ -111,6 +156,22 @@ describe("verify-pr-hosted-gates", () => {
111156 ) . toThrow ( "Missing successful exact-head CI workflow" ) ;
112157 } ) ;
113158
159+ it ( "rejects a manual release-gate title from another workflow" , ( ) => {
160+ expect ( ( ) =>
161+ collectHostedGateEvidence ( {
162+ sha,
163+ workflowRuns : [
164+ {
165+ ...successfulRun ( `CI release gate ${ sha } ` , 1 , "2026-06-17T10:47:00Z" ) ,
166+ event : "workflow_dispatch" ,
167+ path : ".github/workflows/something-else.yml" ,
168+ display_title : `CI release gate ${ sha } ` ,
169+ } ,
170+ ] ,
171+ } ) ,
172+ ) . toThrow ( "Missing successful exact-head CI workflow" ) ;
173+ } ) ;
174+
114175 it ( "requires CI for docs unless the head changes only CHANGELOG.md" , ( ) => {
115176 expect ( ( ) => collectHostedGateEvidence ( { sha, workflowRuns : [ ] } ) ) . toThrow (
116177 "Missing successful exact-head CI workflow" ,
0 commit comments