-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
37 lines (32 loc) · 1.06 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Checks API example
// See: https://developer.github.com/v3/checks/ to learn more
/**
* This is the main entrypoint to your Probot app
* @param {import('probot').Application} app
*/
module.exports = app => {
app.on(['check_suite.requested', 'check_run.rerequested'], check)
async function check (context) {
const startTime = new Date()
// Do stuff
const { head_branch: headBranch, head_sha: headSha } = context.payload.check_suite
// Probot API note: context.repo() => {username: 'hiimbex', repo: 'testing-things'}
return context.github.checks.create(context.repo({
name: 'My app!',
head_branch: headBranch,
head_sha: headSha,
status: 'completed',
started_at: startTime,
conclusion: 'success',
completed_at: new Date(),
output: {
title: 'Probot check!',
summary: 'The check has passed!'
}
}))
}
// For more information on building apps:
// https://probot.github.io/docs/
// To get your app running against GitHub, see:
// https://probot.github.io/docs/development/
}