This repository serves as the event source for the webhook receiver application. It's designed to trigger GitHub webhook events that are captured by the webhook receiver, demonstrating real-time GitHub integration capabilities.
This repository is used to generate GitHub webhook events (push, pull request, merge) that are sent to the webhook receiver application. It contains sample files that can be modified to trigger webhook events for testing and demonstration purposes.
This repository is specifically designed to generate three types of GitHub webhook events:
Triggered when code is pushed to any branch
- Action:
git push - Result: Webhook event sent to receiver
- Display: Author, branch, timestamp
Triggered when pull requests are created
- Action: Create PR via GitHub interface
- Result: Webhook event sent to receiver
- Display: Author, source→target branches, timestamp
Triggered when pull requests are merged
- Action: Merge PR via GitHub interface
- Result: Webhook event sent to receiver
- Display: Merger, merged branches, timestamp
This Repository (action-repo)
↓ Triggers webhook events
GitHub Webhooks API
↓ Sends events to
Webhook Receiver Application
↓ Displays events in
Real-time Dashboard
To connect this repository to your webhook receiver:
- Go to Settings → Webhooks → Add webhook
- Configure as follows:
Payload URL: https://your-ngrok-url.ngrok.io/webhook Content type: application/json Secret: (optional, match your receiver config) Events: Push Pull requests Active: Yes
- Webhook is Active
- Events include Push and Pull requests
- Payload URL points to your webhook receiver
- Content type is application/json
# Clone this repository
git clone https://github.com/sharmaasahill/action-repo.git
cd action-repo
# Make a simple change
echo "Test change at $(date)" >> test-file.txt
# Commit and push
git add .
git commit -m "Test: Trigger push webhook event"
git push origin mainExpected Result: Push event appears in webhook receiver dashboard
# Create a feature branch
git checkout -b feature/webhook-test-$(date +%s)
# Make changes
echo "Feature: Webhook testing at $(date)" >> feature.txt
git add .
git commit -m "Add: Feature for PR webhook testing"
# Push feature branch
git push origin feature/webhook-test-$(date +%s)Then on GitHub:
- Navigate to this repository
- Click "Compare & pull request" button
- Add title:
Test: PR webhook event - Click "Create pull request"
Expected Result: Pull request event appears in webhook receiver dashboard
After creating the pull request above:
- Click "Merge pull request" button
- Confirm merge by clicking "Confirm merge"
- Optionally delete the feature branch
Expected Result: Merge event appears in webhook receiver dashboard
| File | Purpose | Usage |
|---|---|---|
README.md |
Documentation | You're reading it! |
test-file.txt |
Push testing | Modify for push events |
feature.txt |
PR/Merge testing | Use in feature branches |
sample-code.py |
Demo content | Example code for commits |
All webhook events generated by this repository can be monitored in real-time:
- URL:
http://localhost:5000(when receiver is running) - Updates: Every 15 seconds automatically
- Display: All events with timestamps and details
- Push:
{author} pushed to {branch} on {timestamp} - Pull Request:
{author} submitted a pull request from {from_branch} to {to_branch} on {timestamp} - Merge:
{author} merged branch {from_branch} to {to_branch} on {timestamp}
Use this checklist to verify all webhook events are working:
- Webhook configured in repository settings
- Receiver application running at webhook URL
- Push event - Make commit and push
- Pull request event - Create PR from feature branch
- Merge event - Merge the PR
- Real-time display - Events appear in dashboard
- Correct formatting - Events match expected format
# Quick push test
echo "Quick test $(date)" >> test-file.txt && git add . && git commit -m "Quick webhook test" && git push
# Quick feature branch
git checkout -b quick-test-$(date +%s) && echo "Feature $(date)" >> feature.txt && git add . && git commit -m "Quick PR test" && git push origin quick-test-$(date +%s)# Return to main branch
git checkout main
# Delete test branches (optional)
git branch -d feature/test-branch-name
# Remove test content (optional)
git checkout HEAD~1 -- test-file.txtSimple text file used for testing push events. Modify this file and push changes to trigger push webhook events.
Feature development file used for testing pull request and merge events. Create feature branches and modify this file to test PR and merge workflows.
Sample Python code file that can be modified to trigger webhook events. Useful for demonstrating code changes in commits and pull requests.
This repository works in conjunction with:
- webhook-repo - Main webhook receiver application
- Setup: Configure webhook pointing to receiver application
- Test: Follow testing guide for each event type
- Monitor: Watch events appear in real-time dashboard
- Verify: Confirm all event types work correctly