@@ -107,6 +107,7 @@ function evaluateWorkflowExpression(
107107 headRepository ?: string ;
108108 hostedRunnerProfileContract ?: boolean ;
109109 matrix ?: Record < string , unknown > ;
110+ releaseGate ?: boolean ;
110111 repository : string ;
111112 runCheck ?: boolean ;
112113 runnerBackend ?: "" | "blacksmith" | "github" | "hybrid" ;
@@ -146,6 +147,9 @@ function evaluateWorkflowExpression(
146147 }
147148 : { } ,
148149 } ,
150+ inputs : {
151+ release_gate : context . releaseGate ?? false ,
152+ } ,
149153 matrix : context . matrix ?? { } ,
150154 needs : {
151155 preflight : {
@@ -3629,6 +3633,42 @@ NODE
36293633 ) . toBe ( 96 ) ;
36303634 } ) ;
36313635
3636+ it ( "honors trusted dispatch runner selection for check shards" , ( ) => {
3637+ const runsOn = readCiWorkflow ( ) . jobs [ "check-shard" ] [ "runs-on" ] ;
3638+ const lintMatrix = {
3639+ runner : "blacksmith-32vcpu-ubuntu-2404" ,
3640+ task : "lint" ,
3641+ } ;
3642+ const evaluateDispatch = (
3643+ runnerBackend : "blacksmith" | "github" | "hybrid" ,
3644+ releaseGate = false ,
3645+ ) =>
3646+ evaluateWorkflowExpression ( runsOn , {
3647+ eventName : "workflow_dispatch" ,
3648+ matrix : lintMatrix ,
3649+ releaseGate,
3650+ repository : "openclaw/openclaw" ,
3651+ runAttempt : 1 ,
3652+ runnerBackend,
3653+ } ) ;
3654+
3655+ expect ( evaluateDispatch ( "blacksmith" ) ) . toBe ( "blacksmith-32vcpu-ubuntu-2404" ) ;
3656+ expect ( evaluateDispatch ( "blacksmith" , true ) ) . toBe ( "ubuntu-24.04" ) ;
3657+ expect ( evaluateDispatch ( "github" ) ) . toBe ( "ubuntu-24.04" ) ;
3658+ expect ( evaluateDispatch ( "hybrid" ) ) . toBe ( "ubuntu-24.04" ) ;
3659+ expect (
3660+ evaluateWorkflowExpression ( runsOn , {
3661+ authorAssociation : "NONE" ,
3662+ eventName : "pull_request" ,
3663+ headRepository : "openclaw/openclaw" ,
3664+ matrix : lintMatrix ,
3665+ repository : "openclaw/openclaw" ,
3666+ runAttempt : 1 ,
3667+ runnerBackend : "blacksmith" ,
3668+ } ) ,
3669+ ) . toBe ( "ubuntu-24.04" ) ;
3670+ } ) ;
3671+
36323672 it ( "encodes GitHub, Blacksmith, and hybrid runner-backend shapes" , ( ) => {
36333673 const workflow = readCiWorkflow ( ) ;
36343674 const jobs = workflow . jobs as Record < string , { "runs-on" : unknown } > ;
0 commit comments