Function auth

  • Authenticate 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();
    });
    };

    Parameters

    • state: State

      Probot application instance state, which is used to persist

    • Optional installationId: number

    Returns Promise<InstanceType<typeof ProbotOctokit>>

    An authenticated GitHub API client