Edits history of script submission #22398 for ' Get Repository (github)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { Octokit } from "@octokit/rest";
    
    /**
     * @param owner The account owner of the repository. The name is not case sensitive.
     *
     * @param repo The name of the repository. The name is not case sensitive.
     */
    type Github = {
      token: string;
    };
    export async function main(gh_auth: Github, owner: string, repo: string) {
      const octokit = new Octokit({ auth: gh_auth.token });
    
      return await octokit.request("GET /repos/{owner}/{repo}", {
        owner,
        repo,
        headers: {
          "X-GitHub-Api-Version": "2022-11-28",
          Accept: "application/vnd.github+json",
        },
      });
    }
    

    Submitted by hugo989 7 days ago