Building GitHub Apps with Probot

"I wish GitHub had this feature..."

Todo

Automatically create issues from todos in code

Dep

Block merging until all pull request dependencies have been merged

GitHub + Slack Integration

Post GitHub events to Slack (and many other features)

Linter Alex

Catch insensitive writing

Unfurl Links

Adds links previews to comments

What is Probot?

  • Framework for building GitHub Apps in Node.js
  • Granular permissions
  • Handles receiving and validating webhooks, authentication, local development set-up for you
  • Includes Octokit for easy API access
  • Supports GitHub's GraphQL API
  • Great documentation

What can Probot do?

  • Anything a user can do!
  • Commit new files
  • Create pull requests
  • Add comments
  • Move issues on project boards
  • etc.
module.exports = app => {
  app.on('issues.opened', async context => {
    // `context` extracts information from the event, which can be passed to
    // GitHub API calls. This will return:
    //   { owner: 'yourname', repo: 'yourrepo', number: 123, body: 'Hello World !}
    const params = context.issue({ body: 'Hello World!' })

    // Post a comment on the issue
    return context.github.issues.createComment(params)
  })
}

Comment on new issues

Local development

npx create-probot-app my-first-app 
 
yarn create probot-app my-first-app

Develop in the browser

Docs

Probot

By Timon van Spronsen

Probot

  • 302