type Github = {
token: string;
};
/**
* Add a security manager team
* Adds a team as a security manager for an organization.
*/
export async function main(auth: Github, org: string, team_slug: string) {
const url = new URL(
`https://api.github.com/orgs/${org}/security-managers/teams/${team_slug}`
);
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;
};
/**
* Add a security manager team
* Adds a team as a security manager for an organization.
*/
export async function main(auth: Github, org: string, team_slug: string) {
const url = new URL(
`https://api.github.com/orgs/${org}/security-managers/teams/${team_slug}`
);
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