Last active
August 5, 2021 10:02
-
-
Save larsxschneider/d69b98422a912b86ff04f3c95db3ad9c to your computer and use it in GitHub Desktop.
GitHub app based on https://probot.github.io to demo Autolinks
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 main entrypoint to your Probot app | |
* @param {import('probot').Probot} app | |
*/ | |
module.exports = (app) => { | |
// Your code here | |
app.log.info("Yay, the app was loaded!"); | |
app.on("issues.opened", async (context) => { | |
context.octokit.request(`GET /repos/${context.payload.repository.full_name}/autolinks`) | |
.then(response => { | |
const issueComment = context.issue({ | |
body: '```\n' + JSON.stringify(response.data, null, 2) + '\n```', | |
}); | |
return context.octokit.issues.createComment(issueComment); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment