4 - GitHub Apps
In this lab you will develop a GitHub App using the Probot framework.
Duration: 15-20 minutes
References:
- GitHub Apps
- Creating a GitHub App
- GitHub Apps - Probot
- GitHub Apps - Probot - Best practices
- GitHub Developer - GitHub Apps Cheat Sheet
- Creating a GitHub app with create-probot-app: Creating my first GitHub app with Probot - Part 1 (andrewlock.net)
4.1 Developing a GitHub App
- Follow the guide Probot - Developing an app to develop your first GitHub App.
- Choose the
basic-js
template and follow the steps to generate, run, configure, and install your GitHub App. - Once installed on your repository, use
npm start
to start your application and listen to webhook events. - Test your application by creating a new issue on the installed repository
- Update the
index.js
file to add the following listener:app.onAny(async (context) => { app.log.info({ event: context.name, action: context.payload.action }); });
- Run the application
npm start
- Navigate to your repository where the application is installed
- Add a new label to an existing issue, push new code or update the repository settings
- Watch the application logs for triggered events