Get GitHub Actions billing for an organization

*Note*: Description borrowed from official documentation at https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/master/docs/search/issuesAndPullRequests.md) --- Gets the summary of the free and paid GitHub Actions minutes used. Access tokens must have the `repo` or `admin:org` scope.

Script github

by lplit ยท 8/26/2022

  • Submitted by lplit Deno
    Created 1352 days ago
    1
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    2
    import { Octokit } from "https://cdn.skypack.dev/octokit?dts";
    3
    
    
    4
    /*
    5
    @param: {wmill.Resource<"github">} gh_auth - Resource containing Github Auth API Key
    6
    Example:
    7
    {
    8
      auth: github_api_key
    9
    }
    10
    */
    11
    export async function main(
    12
      gh_auth: wmill.Resource<"github">,
    13
      organizationName: string,
    14
    ) {
    15
      const octokit = new Octokit(gh_auth);
    16
      const response = await octokit.rest.billing.getGithubActionsBillingOrg({
    17
        org: organizationName,
    18
      });
    19
    
    
    20
      return response;
    21
    }
    22