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 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 +})