Simple GitHub App that automatically closes issues when they're opened or reopened. Demonstrates basic webhook handling and GitHub API interaction.
- Automatically closes new issues with a comment
- Closes reopened issues with a comment
- Provides status endpoints
-
Copy the environment template:
cp .env.example .env
-
Fill in your GitHub App credentials in
.env -
Run the app:
python app.py
-
The app will be available at http://localhost:5000
When creating your GitHub App, set:
- Webhook URL:
http://your-domain.com/webhooks/github/ - Repository permissions:
- Issues: Write (to close issues and add comments)
- Metadata: Read
- Subscribe to events:
- Issues
- Install the GitHub App on a test repository
- Create a new issue
- Watch it get automatically closed with a comment
- Try reopening the issue - it will be closed again
This demonstrates the core functionality of GitHub Apps: receiving webhooks and taking actions via the GitHub API.