A powerful GitHub App built for GSOC (Google Summer of Code) that automatically responds to pull requests with intelligent comments. Built with TypeScript, Express, and Bun.
- 🤖 Automatic PR greeting and response
- 📝 Detailed PR information in comments
- 🔒 Secure JWT-based authentication
- 🎯 Webhook event handling
- 📊 Detailed logging system
- Runtime: Bun v1.2.4
- Language: TypeScript
- Framework: Express.js
- Authentication: JSON Web Tokens (JWT)
- HTTP Client: Axios
- Other Tools: body-parser, jsonwebtoken
- Bun (v1.2.4 or higher)
- A GitHub account
- A registered GitHub App
- Clone the repository:
git clone https://github.com/ashishk15678/electron-webhook.git
cd electron-webhook
- Install dependencies:
bun install
- Create a
.env
file:
DEBUG_MODE=true
LOG_LEVEL=debug
GITHUB_TOKEN=your_github_token
- Go to GitHub Apps settings
- Create a new GitHub App
- Set permissions:
- Pull requests: Read & Write
- Issues: Read & Write
- Generate and download private key
- Install the app in your repository
- Copy the Installation ID from the URL
- Generate an access token using the provided JWT authentication
Development mode:
bun run index.ts
The server will start on port 3000.
The app automatically:
- Listens for PR webhook events
- Validates incoming payloads
- Responds to new PRs with a welcome message
- Includes PR details in the comment
Key configuration files:
tsconfig.json
: TypeScript configuration.env
: Environment variablespackage.json
: Project dependenciesfunctions.ts
: Core PR handling logicjwt.ts
: Authentication utilities
This project is part of Google Summer of Code, focusing on:
- Automating PR workflows
- Improving developer experience
- Implementing best practices for GitHub Apps
- Contributing to open source
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2024 [Your Name]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Ashish Kumar - @ashish15678 - 15678ashish@gmail.com
Project Link: https://github.com/ashishk15678/electron-webhook