Search Issues and Pull Requests

Note: Description borrowed from official documentation at https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/master/docs/search/issuesAndPullRequests.md) --- Find issues by state and keyword. This method returns up to 100 results per page. When searching for issues, you can get text match metadata for the issue title, issue body, and issue comment body fields when you pass the text-match media type. For more details about how to receive highlighted search results, see Text match metadata. For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. `q=windows+label:bug+language:python+state:open&sort=created&order=asc` This query searches for the keyword windows, within any open issue that is labeled as bug. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.

Script github

by maximebrandiele ยท 6/6/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 = "org:windmill-labs feat",
    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.issuesAndPullRequests({
    22
        q: query, sort: sort, order: order, per_page: per_page, page: page
    23
      });
    24
    
    
    25
      return response;
    26
    }
    27