https://github.com/ragibalasad/thanks-for-the-star
Star this repo and get an instant follow back 💖
https://github.com/ragibalasad/thanks-for-the-star
automation github-webhook nextjs14 serverless-function
Last synced: about 1 year ago
JSON representation
Star this repo and get an instant follow back 💖
- Host: GitHub
- URL: https://github.com/ragibalasad/thanks-for-the-star
- Owner: ragibalasad
- License: bsd-3-clause
- Created: 2025-04-23T21:24:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-24T13:22:09.000Z (about 1 year ago)
- Last Synced: 2025-06-01T14:17:28.200Z (about 1 year ago)
- Topics: automation, github-webhook, nextjs14, serverless-function
- Language: Python
- Homepage: https://thanks-for-the-star.vercel.app
- Size: 36.1 KB
- Stars: 20
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Automatically follow people who star your repo ✨
Give back with a follow, powered by Next.js & GitHub Webhook
##### Star this repo and get an instant follow back 💖
##
A Next.js 14 serverless GitHub webhook API to auto-follow users who star your repo — ported from the Python version to Next.js API route with full secret verification and logging.
## How it works
When someone stars this repo, GitHub sends a webhook that triggers this API. It:
- Validates the webhook signature
- Follows the user by sending a PUT request to `https://api.github.com/user/following/{username}` with the GitHub token in the `Authorization` header (`Bearer `).
## Features
- Secure webhook secret validation
- Instant follow-back of new stargazers
- Simple setup with environment variables
- Logs for success and errors
## Setup
You can set this up yourself to automatically follow users who star your repository.
1. Clone or download this repo
2. Rename `.env.example` to `.env.local` and fill in your values:
```
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_WEBHOOK_SECRET=your_webhook_secret
```
- The GitHub token needs the `user:follow` scope.
3. Deploy on Vercel
4. Add the webhook URL to your GitHub repo settings:
```
https://your-vercel-app.vercel.app/api/webhook
```
- Content type: `application/json`
- Secret: same as `GITHUB_WEBHOOK_SECRET`
## Logs & Debugging
Logs are printed in Vercel serverless function console.
## License
BSD-3-Clause license