From bf5b8e5e91fb69221c1c9df4ea57ecdcd80a1d42 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 1 Dec 2026 15:01:49 +0100 Subject: [PATCH 1/2] trigger-workflow-dispatch: drop obsolete `return_run_details` attribute This used to be needed to get _some_ information back, but now it no longer works: "return_run_details" is not an object Seems that the newest API version silently dropped this flag. Signed-off-by: Johannes Schindelin --- GitGitGadget/trigger-workflow-dispatch.js | 2 +- __tests__/trigger-workflow-dispatch.test.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/GitGitGadget/trigger-workflow-dispatch.js b/GitGitGadget/trigger-workflow-dispatch.js index 6a023c5..0d2a74a 100644 --- a/GitGitGadget/trigger-workflow-dispatch.js +++ b/GitGitGadget/trigger-workflow-dispatch.js @@ -49,7 +49,7 @@ const triggerWorkflowDispatch = async (context, token, owner, repo, workflow_id, token, 'POST', `/repos/${owner}/${repo}/actions/workflows/${workflow_id}/dispatches`, - { ref, inputs, return_run_details: true } + { ref, inputs } ) if (response.workflow_run_id) return response diff --git a/__tests__/trigger-workflow-dispatch.test.js b/__tests__/trigger-workflow-dispatch.test.js index 66ce0e4..5029f85 100644 --- a/__tests__/trigger-workflow-dispatch.test.js +++ b/__tests__/trigger-workflow-dispatch.test.js @@ -65,8 +65,7 @@ test('use workflow run details returned by the dispatch', async () => { expect(mockHTTPSRequest).toHaveBeenCalledTimes(1) expect(mockHTTPSRequest.mock.calls[0][4]).toEqual({ ref: 'HEAD', - inputs: { abc: 123 }, - return_run_details: true + inputs: { abc: 123 } }) }) @@ -79,8 +78,7 @@ test('fall back to waiting for the workflow run', async () => { }) expect(mockHTTPSRequest.mock.calls[0][4]).toEqual({ ref: 'HEAD', - inputs: { abc: 123 }, - return_run_details: true + inputs: { abc: 123 } }) }) @@ -88,4 +86,4 @@ test('list workflow runs', async () => { const context = {} const runs = await listWorkflowRuns(context, 'my-token', 'hello', 'world', 'the-workflow.yml', 'main', 'queued') expect(runs.length).toEqual(2) -}) \ No newline at end of file +}) From 36fbbff02fc78ccf0f3c0a8dfae510ceac93985a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 1 Dec 2026 15:04:13 +0100 Subject: [PATCH 2/2] api-request: request a specific GitHub REST API version We just got surprised with a failure due to an update in the API version: When triggering workflows, the `return_run_details` flag, which used to be required, now triggers an error. Let's avoid getting such nasty surprises by specifying which API version we target. Signed-off-by: Johannes Schindelin --- GitGitGadget/github-api-request-as-app.js | 1 + GitGitGadget/github-api-request.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/GitGitGadget/github-api-request-as-app.js b/GitGitGadget/github-api-request-as-app.js index df055c3..e3fa845 100644 --- a/GitGitGadget/github-api-request-as-app.js +++ b/GitGitGadget/github-api-request-as-app.js @@ -38,6 +38,7 @@ const gitHubAPIRequestAsApp = async (context, requestMethod, requestPath, body) body, { Authorization: `Bearer ${token}`, + 'X-GitHub-Api-Version': '2026-03-10', } ) } diff --git a/GitGitGadget/github-api-request.js b/GitGitGadget/github-api-request.js index 24f26e1..495a15c 100644 --- a/GitGitGadget/github-api-request.js +++ b/GitGitGadget/github-api-request.js @@ -1,6 +1,9 @@ const gitHubAPIRequest = async (context, token, method, requestPath, payload) => { const { httpsRequest } = require('./https-request') - const headers = token ? { Authorization: `Bearer ${token}` } : null + const headers = { + 'X-GitHub-Api-Version': '2026-03-10', + ...(token ? { Authorization: `Bearer ${token}` } : {}), + } const answer = await httpsRequest(context, null, method, requestPath, payload, headers) if (answer.error) throw answer.error return answer