Created
June 29, 2018 16:28
-
-
Save hiimbex/71b7b55cde250bd69bb470d13f97e905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
module.exports = app => { | |
// Your code here | |
app.on('issues.opened', async context => { | |
app.log(context.issue()) | |
// => {owner: 'username', repo: 'reponame', number: 123} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
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']} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
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