
GitHub Search
CertifiedSearch code
GitHub Search
Search code
Runs a GitHub code search and writes matching file metadata to Kestra internal storage. This task uses rendered property values and defaults to BEST_MATCH sorted in ascending order.
type: io.kestra.plugin.github.code.SearchExamples
Search for code in a repository.
id: github_code_search_flow
namespace: company.team
tasks:
- id: search_code
type: io.kestra.plugin.github.code.Search
oauthToken: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
query: "addClass in:file language:js repo:jquery/jquery"
Search for code in a repository.
id: github_code_search_flow
namespace: company.team
tasks:
- id: search_code
type: io.kestra.plugin.github.code.Search
oauthToken: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
query: addClass
in: file
language: js
repository: jquery/jquery
Properties
appInstallationToken string
GitHub App installation token
Installation access token generated by a GitHub App. Use this for repository-scoped app access instead of a user token.
endpoint string
GitHub API endpoint
GitHub or GitHub Enterprise API base URL such as https://api.github.com or https://ghe.acme.com/api/v3. Set this when targeting GitHub Enterprise or a non-default API endpoint.
extension string
File extension filter
Matches files with the given extension
fetchType string
STORESTOREFETCHFETCH_ONENONEResult handling mode
Controls how hits are exposed in outputs; default FETCH returns all hits in the response. FETCH_ONE returns only the first hit, STORE writes hits to Kestra storage and returns a URI, and NONE leaves outputs empty.
filename string
File name filter
Matches files with this exact name
fork string
PARENT_AND_FORKSFORKS_ONLYPARENT_ONLYInclude forks
Controls whether the search includes the parent repository, forks, or both
in string
Fields to search
Comma-separated in: targets such as file,path. Leave unset to search all supported fields
jwtToken string
GitHub JWT token
GitHub App JWT used for app-level authentication. Use this when the task should authenticate as the app rather than a user.
language string
Language filter
Programming language qualifier
login string
GitHub login
GitHub login used with oauthToken for authenticated requests. Leave unset when authenticating with jwtToken or appInstallationToken.
oauthToken string
GitHub OAuth token
GitHub personal access token used for authenticated requests. Can be used alone or with login.
order string
ASCASCDESCSort direction
ASC sorts ascending (default); DESC sorts descending.
path string
Path prefix filter
Limits results to files under this path
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
query string
Search keywords and qualifiers
GitHub code search syntax combining keywords with qualifiers like repo, path, language.
repository string
Repository to search
owner/repo value used for the repo: qualifier
size string
File size filter
Supports >, <, and range syntax (..) in bytes
sort string
BEST_MATCHBEST_MATCHINDEXEDSort field
BEST_MATCH ranks by relevance (default); INDEXED sorts by index time.
user string
User scope
Limits the search to repositories owned by the given user
Outputs
row object
First hit
Available only when fetchType=FETCH_ONE; contains the first hit source.
rows array
Fetched hits
Available only when fetchType=FETCH; contains hit sources for the current response page.
size integer
Returned hit count
Number of hits included in outputs for the selected fetch type.
total integer
Total hits reported
Total hits reported by GitHub search, regardless of pagination.
uri string
uriStored hits URI
Available only when fetchType=STORE; Kestra internal storage path to the Ion file.