Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions GitGitGadget/github-api-request-as-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const gitHubAPIRequestAsApp = async (context, requestMethod, requestPath, body)
body,
{
Authorization: `Bearer ${token}`,
'X-GitHub-Api-Version': '2026-03-10',
}
)
}
Expand Down
5 changes: 4 additions & 1 deletion GitGitGadget/github-api-request.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion GitGitGadget/trigger-workflow-dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions __tests__/trigger-workflow-dispatch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
})
})

Expand All @@ -79,13 +78,12 @@ 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 }
})
})

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