type Github = {
token: string;
};
/**
* Enable automated security fixes
* Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)".
*/
export async function main(auth: Github, owner: string, repo: string) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/automated-security-fixes`
);
const response = await fetch(url, {
method: "PUT",
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 367 days ago
type Github = {
token: string;
};
/**
* Enable automated security fixes
* Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)".
*/
export async function main(auth: Github, owner: string, repo: string) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/automated-security-fixes`
);
const response = await fetch(url, {
method: "PUT",
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 927 days ago