Search commits

(Description borrowed from official documentation at https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/master/docs/search/commits.md) --- Find commits via various criteria on the default branch (usually master). This method returns up to 100 results per page. When searching for commits, you can get text match metadata for the message field when you provide the text-match media type. For more details about how to receive highlighted search results, see Text match metadata.

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
    
    
    12
    export async function main(
    13
      gh_auth: wmill.Resource<"github">,
    14
      query: string,
    15
      sort?: string,
    16
      order?: string,
    17
      per_page?: number,
    18
      page?: number,
    19
    ) {
    20
      const octokit = new Octokit(gh_auth);
    21
      const response = await octokit.rest.search.commits({
    22
        q: query, sort: sort, order: order, per_page: per_page, page: page
    23
      });
    24
    
    
    25
      return response;
    26
    }