Skip to content

Instantly share code, notes, and snippets.

@larsxschneider
Last active August 5, 2021 10:02
Show Gist options
  • Save larsxschneider/d69b98422a912b86ff04f3c95db3ad9c to your computer and use it in GitHub Desktop.
Save larsxschneider/d69b98422a912b86ff04f3c95db3ad9c to your computer and use it in GitHub Desktop.
GitHub app based on https://probot.github.io to demo Autolinks
/**
* 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