@@ -100,10 +100,16 @@ describe("API", () => {
100100 url : "https://github.com/owner/repo/actions/runs/123456" ,
101101 } ) ;
102102
103- // The run details are opt-in, so the request must ask for them
104- expect ( dispatchedRequest ?. return_run_details ) . toStrictEqual ( true ) ;
105- // Only the caller's inputs are forwarded, nothing is injected
106- expect ( dispatchedRequest ?. inputs ) . toStrictEqual ( { testInput : "test" } ) ;
103+ // Only the pinned API version returns the run details, and only the
104+ // caller's inputs are forwarded
105+ expect ( dispatchedRequest ) . toStrictEqual ( {
106+ owner : "owner" ,
107+ repo : "repo" ,
108+ workflow_id : "workflow" ,
109+ ref : "ref" ,
110+ inputs : { testInput : "test" } ,
111+ headers : { "x-github-api-version" : "2026-03-10" } ,
112+ } ) ;
107113
108114 // Logging
109115 assertOnlyCalled ( coreInfoLogMock ) ;
@@ -119,7 +125,7 @@ describe("API", () => {
119125 ` ) ;
120126 } ) ;
121127
122- it ( "should throw for an empty 204, as returned by servers without return_run_details support " , async ( ) => {
128+ it ( "should throw for an empty 204, as returned by servers that ignore the API version " , async ( ) => {
123129 vi . spyOn (
124130 mockOctokit . rest . actions ,
125131 "createWorkflowDispatch" ,
@@ -147,11 +153,13 @@ describe("API", () => {
147153 ) ;
148154 } ) ;
149155
150- it ( "should restate the server requirement for a 400 rejecting the unknown field " , async ( ) => {
151- // Servers predating `return_run_details` reject it outright rather than
152- // ignoring it , so the empty 204 path is never reached.
156+ it ( "should restate the server requirement for a 400 rejecting the API version " , async ( ) => {
157+ // Servers predating the pinned version reject it outright rather than
158+ // falling back , so the empty 204 path is never reached.
153159 const requestError = Object . assign (
154- new Error ( 'Unknown request body field: "return_run_details"' ) ,
160+ new Error (
161+ 'The version you specified in the "X-GitHub-API-Version" request header, "2026-03-10", is not a supported version.' ,
162+ ) ,
155163 { status : 400 } ,
156164 ) ;
157165 vi . spyOn (
@@ -165,7 +173,7 @@ describe("API", () => {
165173 ) ;
166174 // The original message is retained for diagnosis
167175 await expect ( dispatchWorkflow ( ) ) . rejects . toThrow (
168- 'Unknown request body field: "return_run_details"' ,
176+ "is not a supported version" ,
169177 ) ;
170178
171179 // Logging
0 commit comments