Slide 1

Slide 1 text

Automating your Workflow with Probot Bex Warner @GitHub

Slide 2

Slide 2 text

• Automation • Automating GitHub • What is Probot • Existing Probot Apps • Building a Probot App

Slide 3

Slide 3 text

Automating Process

Slide 4

Slide 4 text

Identify repeated tasks “We {action} every {period of time}.”

Slide 5

Slide 5 text

Identify repeated tasks “We release a changelog every two weeks.”

Slide 6

Slide 6 text

Giphy.com

Slide 7

Slide 7 text

What does automation look like on GitHub?

Slide 8

Slide 8 text

OAuth Apps

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

github.com/dear-github/dear-github

Slide 12

Slide 12 text

GitHub Apps

Slide 13

Slide 13 text

Granular permissions

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

You’ve probably seen it in action

Slide 17

Slide 17 text

You’ve probably seen it in action

Slide 18

Slide 18 text

You’ve probably seen it in action

Slide 19

Slide 19 text

So we understand GitHub and Automation…

Slide 20

Slide 20 text

Giphy.com

Slide 21

Slide 21 text

probot.github.io

Slide 22

Slide 22 text

Listen on Webhooks Take action via the GitHub API

Slide 23

Slide 23 text

Authentication JWT + installation access token

Slide 24

Slide 24 text

GitHub APIs REST, GraphQl, Octokits

Slide 25

Slide 25 text

Authenticated Octokit client

Slide 26

Slide 26 text

Existing Apps

Slide 27

Slide 27 text

probot.github.io/apps

Slide 28

Slide 28 text

Stale >49k public issues ~850 organizations Close stale Issues and Pull Requests

Slide 29

Slide 29 text

Reminders >200 organizations Set reminders on Issues and Pull Requests

Slide 30

Slide 30 text

Welcome > 3600 public issues + PRs >180 organizations Welcomes new users

Slide 31

Slide 31 text

WIP >550 organizations Blocks Pull Requests with WIP in the title

Slide 32

Slide 32 text

Let’s get started

Slide 33

Slide 33 text

probot.github.io

Slide 34

Slide 34 text

github.com/probot/create-probot-app https://carbon.now.sh/

Slide 35

Slide 35 text

Scaffolding

Slide 36

Slide 36 text

Webhook Delivery ngrok, localtunnel

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

My custom smee URL

Slide 39

Slide 39 text

smee.io/my-custom-url event stream

Slide 40

Slide 40 text

Creating a GitHub App

Slide 41

Slide 41 text

Download a private key

Slide 42

Slide 42 text

updating your .env https://carbon.now.sh/

Slide 43

Slide 43 text

Let’s write some code

Slide 44

Slide 44 text

index.js https://carbon.now.sh/

Slide 45

Slide 45 text

Identify repeated tasks “We {action} every {period of time}.”

Slide 46

Slide 46 text

Identify repeated tasks “We add a label for every every new issue.”

Slide 47

Slide 47 text

`app.on` listening for webhooks https://carbon.now.sh/

Slide 48

Slide 48 text

Listening on `issues.opened` https://carbon.now.sh/

Slide 49

Slide 49 text

https://octokit.github.io/rest.js/#api-Issues-addLabels

Slide 50

Slide 50 text

Add necessary params https://carbon.now.sh/

Slide 51

Slide 51 text

Make the API call https://carbon.now.sh/

Slide 52

Slide 52 text

Watch it work!

Slide 53

Slide 53 text

What other things can I do with GitHub Apps?

Slide 54

Slide 54 text

Checks API https://blog.github.com/2018-05-07-introducing- checks-api/

Slide 55

Slide 55 text

https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/

Slide 56

Slide 56 text

https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/

Slide 57

Slide 57 text

https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/

Slide 58

Slide 58 text

https://developer.github.com/changes/2018-05-23-request-actions-on-checks/

Slide 59

Slide 59 text

https://developer.github.com/changes/2018-05-23-request-actions-on-checks/

Slide 60

Slide 60 text

GitHub Developer Program

Slide 61

Slide 61 text

We’re hiring! https://github.com/about/careers

Slide 62

Slide 62 text

probot.github.io [email protected] @hiimbex @hiimbexo Bex Warner GitHub