type Github = {
token: string;
};
/**
* Remove a selected repository from required workflow
* Removes a repository from a required workflow. To use this endpoint, the required workflow must be configured to run on selected repositories.
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
For more information, see "[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows)."
*/
export async function main(
auth: Github,
org: string,
required_workflow_id: string,
repository_id: string
) {
const url = new URL(
`https://api.github.com/orgs/${org}/actions/required_workflows/${required_workflow_id}/repositories/${repository_id}`
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 328 days ago