Get Repo Star Count ( github)
One script reply has been approved by the moderators Verified

Created by rossmccrann 271 days ago Viewed 149 times 1 Point

No comments yet

Login to be able to comment
Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.12.0/index.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">,
    owner: string,
    repo: string,
) {
    const octokit = new Octokit(gh_auth);
    const response = await octokit.rest.repos.get({
        owner,
        repo,
    });

    var repo_list = {};

    const arr = response.data;
    repo_list[arr.name] = arr.stargazers_count;

    return repo_list;
}

Submitted by rossmccrann 271 days ago

Edited 27 days ago

No comments yet

Login to be able to comment