Github - Search Code
@sergio
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
github_search_code
Searches file contents via various criteria.
auth
(auths.github)
params
Query

The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com.
To learn more about the format of the query, see Constructing a search query: https://developer.github.com/v3/search/#constructing-a-search-query
For a detailed list of qualifiers see "Searching code": https://help.github.com/en/github/searching-for-information-on-github/searching-code
Due to the complexity of searching code, there are a few restrictions on how searches are performed:

Only the default branch is considered. In most cases, this will be the master branch.
Only files smaller than 384 KB are searchable.
You must always include at least one search term when searching source code. For example, searching for language:go is not valid, while amazing language:go is.

 
string ·params.query
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
}
16
//See the API docs here: https://developer.github.com/v3/search/#search-code
const config = {
  url: `https://api.github.com/search/code`,
  params: {
    order: params.order,
    q: params.query,
    sort: params.sort,
  },
  headers: {
    Authorization: `Bearer ${auths.github.oauth_access_token}`,
  },
}
return await require("@pipedreamhq/platform").axios(this, config)