Skip to content

Instantly share code, notes, and snippets.

@hiimbex
Created June 29, 2018 16:28
Show Gist options
  • Save hiimbex/71b7b55cde250bd69bb470d13f97e905 to your computer and use it in GitHub Desktop.
Save hiimbex/71b7b55cde250bd69bb470d13f97e905 to your computer and use it in GitHub Desktop.
/**
* This is the entry point for your Probot App.
* @param {import('probot').Application} app - Probot's Application class.
*/
module.exports = app => {
// Your code here
app.log('Yay, the app was loaded!')
// 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/
}
/**
* This is the entry point for your Probot App.
* @param {import('probot').Application} app - Probot's Application class.
*/
module.exports = app => {
// Your code here
app.on('*', async context => {
app.log(context)
})
}
// ...
module.exports = app => {
// Your code here
app.on('issues.opened', async context => {
app.log(context.issue())
// => {owner: 'username', repo: 'reponame', number: 123}
})
}
// ...
module.exports = app => {
// Your code here
app.on('issues.opened', async context => {
const params = context.issue({labels: ['needs-triage']})
// params => {owner: 'username', repo: 'reponame', number: 123, labels: ['needs-triage']}
})
}
// ...
module.exports = app => {
// Your code here
app.on('issues.opened', async context => {
const params = context.issue({labels: ['needs-triage']})
// => {owner: 'username', repo: 'reponame', number: 123, labels: ['needs-triage']}
await context.github.issues.addLabels(params)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment