//native
/**
* Re-run Failed Jobs
* Re-run only the failed jobs (and their dependents) of a completed GitHub Actions workflow run. OAuth connections need the workflow scope.
*/
export async function main(
auth: RT.Github,
owner: string,
repo: string,
run_id: number,
) {
const response = await fetch(
`https://api.github.com/repos/${owner}/${repo}/actions/runs/${run_id}/rerun-failed-jobs`,
{
method: "POST",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
},
},
)
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return { success: true }
}
Submitted by hugo989 2 hours ago