$ show github/github-app-js-sample
This repository is a sample GitHub App that demonstrates how to use webhooks with a GitHub App's installation token to create a bot that responds to pull request events. The application listens for `pull_request.opened` webhook events and automatically comments on the pull request with a predefined message from `message.md`. It is built with Node.js, uses the Octokit library for GitHub API interactions, and the `@octokit/webhooks` middleware to handle webhook verification and routing. The architecture is a simple HTTP server that exposes a `/api/webhook` endpoint. The code is straightforward and serves as a minimal example for developers to understand the basics of building a GitHub App. It includes environment variable configuration via dotenv, private key loading from file, and basic error handling. There are no tests, no complex data flows, and no reusable components beyond the pattern itself.