Created by lplit 215 days ago Viewed 0 times 0 Points
(Description borrowed from official documentation at https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/master/docs/orgs/createInvitation.md)
Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
No comments yet
import * as wmill from "https://deno.land/x/windmill@v1.34.0/mod.ts";
import { Octokit } from "https://cdn.skypack.dev/octokit?dts";
/*
@param: {wmill.Resource<"github">} gh_auth - Resource containing Github Auth API Key
example:
{
auth: github_api_key
}
*/
export async function main(
gh_auth: wmill.Resource<"github">,
organizationName: string,
inviteeId: string,
email: string,
role?: "admin" | "direct_member" | "billing_manager",
teamIds?: string,
) {
const octokit = new Octokit(gh_auth);
const response = await octokit.rest.orgs.createInvitation({
org: organizationName,
invitee_id: inviteeId,
email: email,
role: role,
team_ids: teamIds,
});
return response;
}
No comments yet