A pino instance
+An Octokit instance
+The webhook event payload
+Returns a boolean if the actor on the event was a bot.
+Reads the app configuration from the given YAML file in the .github
+directory of the repository.
For example, given a file named .github/config.yml
:
close: true
+comment: Check the specs on the rotary girder.
+
+
+Your app can read that file from the target repository:
+// Load config from .github/config.yml in the repository
const config = await context.config('config.yml')
if (config.close) {
context.octokit.issues.comment(context.issue({body: config.comment}))
context.octokit.issues.edit(context.issue({state: 'closed'}))
}
+
+
+You can also use a defaultConfig
object:
// Load config from .github/config.yml in the repository and combine with default config
const config = await context.config('config.yml', {comment: 'Make sure to check all the specs.'})
if (config.close) {
context.octokit.issues.comment(context.issue({body: config.comment}));
context.octokit.issues.edit(context.issue({state: 'closed'}))
}
+
+
+Config files can also specify a base that they extend. deepMergeOptions
can be used
+to configure how the target config, extended base, and default configs are merged.
For security reasons, configuration is only loaded from the repository's default branch, +changes made in pull requests from different branches or forks are ignored.
+If you need more lower-level control over reading and merging configuration files,
+you can context.octokit.config.get(options)
, see https://github.com/probot/octokit-plugin-config.
Configuration object read from the file
+Return the owner
, repo
, and issue_number
params for making API requests
+against an issue. The object passed in will be merged with the repo params.
const params = context.issue({body: 'Hello World!'})
// Returns: {owner: 'username', repo: 'reponame', issue_number: 123, body: 'Hello World!'}
+
+
+Optional
object: TParams to be merged with the issue params.
+Return the owner
, repo
, and pull_number
params for making API requests
+against a pull request. The object passed in will be merged with the repo params.
const params = context.pullRequest({body: 'Hello World!'})
// Returns: {owner: 'username', repo: 'reponame', pull_number: 123, body: 'Hello World!'}
+
+
+Optional
object: TParams to be merged with the pull request params.
+Return the owner
and repo
params for making API requests against a
+repository.
const params = context.repo({path: '.github/config.yml'})
// Returns: {owner: 'username', repo: 'reponame', path: '.github/config.yml'}
+
+
+Optional
object: TParams to be merged with the repo params.
+Static
versionStatic
defaultsStatic
versionAuthenticate and get a GitHub client that can be used to make API calls.
+You'll probably want to use context.octokit
instead.
Note: app.auth
is asynchronous, so it needs to be prefixed with a
+await
+to wait for the magic to happen.
export default (app) => {
app.on('issues.opened', async context => {
const octokit = await app.auth();
});
};
+
+
+Probot application instance state, which is used to persist
+Optional
installationId: numberOptional
log: LoggerAn authenticated GitHub API client
+Merges configuration from defaults/environment variables/overrides and returns
+a Probot instance. Finds private key using @probot/get-private-key
.
Get an http://expressjs.com|express router that can be used to +expose HTTP endpoints
+Optional
path: stringthe prefix for the routes
+Optional
installationId: numberOptional
log: LoggerReturns an Octokit instance with default settings for authentication. If
+a githubToken
is passed explicitly, the Octokit instance will be
+pre-authenticated with that token when instantiated. Otherwise Octokit's
+app authentication strategy is used, and options.auth
options are merged
+deeply when instantiated.
Besides the authentication, the Octokit's baseUrl is set as well when run +against a GitHub Enterprise Server with a custom domain.
+Probot's transform option, which extends the event
object that is passed
+to webhook event handlers by @octokit/webhooks
set to either a probot application function: (app) => { ... }
or to process.argv
Optional
additionalOptions: AdditionalOptionsOptional
appOptional
baseOptional
githubOptional
hostOptional
logOptional
logOptional
logOptional
OctokitOptional
portOptional
privateOptional
redisOptional
requestOptional
secretOptional
webhookNOTE: exported types might change at any point in time
+NOTE: exported types might change at any point in time
+NOTE: exported types might change at any point in time
+Optional
callback_A full URL to redirect to after someone authorizes an installation. You can provide up to 10 callback URLs.
+Optional
default_The list of events the GitHub App subscribes to.
+Optional
default_The set of permissions needed by the GitHub App. The format of the object uses the permission name for the key (for example, issues
) and the access type for the value (for example, write
).
Optional
description?: stringA description of the GitHub App.
+Optional
hook_The configuration of the GitHub App's webhook.
+Optional
active?: booleanOptional
name?: stringThe name of the GitHub App.
+Optional
public?: booleanSet to true
when your GitHub App is available to the public or false
when it is only accessible to the owner of the app.
Optional
redirect_The full URL to redirect to after a user initiates the registration of a GitHub App from a manifest.
+Optional
request_Set to true
to request the user to authorize the GitHub App, after the GitHub App is installed.
Optional
setup_Set to true
to redirect users to the setup_url after they update your GitHub App installation.
Optional
setup_A full URL to redirect users to after they install your GitHub App if additional setup is required.
+Required. The homepage of your GitHub App.
+Const
Const
Const
The context of the event that was triggered, including the payload and +helpers for extracting information can be passed to GitHub API calls.
+ + +