Skip to content

Test repository for triggering GitHub webhook events (push, pull request, merge). Works with webhook-repo to demonstrate real-time GitHub integration.

Notifications You must be signed in to change notification settings

sharmaasahill/action-repo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action Repository

GitHub Events Status

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.

Overview

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.

Purpose

This repository is specifically designed to generate three types of GitHub webhook events:

Push Events

Triggered when code is pushed to any branch

  • Action: git push
  • Result: Webhook event sent to receiver
  • Display: Author, branch, timestamp

Pull Request Events

Triggered when pull requests are created

  • Action: Create PR via GitHub interface
  • Result: Webhook event sent to receiver
  • Display: Author, source→target branches, timestamp

Merge Events

Triggered when pull requests are merged

  • Action: Merge PR via GitHub interface
  • Result: Webhook event sent to receiver
  • Display: Merger, merged branches, timestamp

Architecture Role

This Repository (action-repo)
       ↓ Triggers webhook events
GitHub Webhooks API
       ↓ Sends events to
Webhook Receiver Application
       ↓ Displays events in
Real-time Dashboard

Webhook Configuration

To connect this repository to your webhook receiver:

Setup Webhook

  1. Go to SettingsWebhooksAdd webhook
  2. 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
    

Verify Configuration

  • Webhook is Active
  • Events include Push and Pull requests
  • Payload URL points to your webhook receiver
  • Content type is application/json

Testing Guide

Test Push Events

# 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 main

Expected Result: Push event appears in webhook receiver dashboard

Test Pull Request Events

# 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:

  1. Navigate to this repository
  2. Click "Compare & pull request" button
  3. Add title: Test: PR webhook event
  4. Click "Create pull request"

Expected Result: Pull request event appears in webhook receiver dashboard

Test Merge Events

After creating the pull request above:

  1. Click "Merge pull request" button
  2. Confirm merge by clicking "Confirm merge"
  3. Optionally delete the feature branch

Expected Result: Merge event appears in webhook receiver dashboard

Repository Contents

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

Event Monitoring

All webhook events generated by this repository can be monitored in real-time:

Webhook Receiver Dashboard

  • URL: http://localhost:5000 (when receiver is running)
  • Updates: Every 15 seconds automatically
  • Display: All events with timestamps and details

Expected Event Formats

  • 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}

Testing Checklist

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 Commands

Rapid Testing Sequence

# 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)

Cleanup Commands

# 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.txt

Files Description

test-file.txt

Simple text file used for testing push events. Modify this file and push changes to trigger push webhook events.

feature.txt

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-code.py

Sample Python code file that can be modified to trigger webhook events. Useful for demonstrating code changes in commits and pull requests.

Related Repositories

This repository works in conjunction with:

Usage Instructions

  1. Setup: Configure webhook pointing to receiver application
  2. Test: Follow testing guide for each event type
  3. Monitor: Watch events appear in real-time dashboard
  4. Verify: Confirm all event types work correctly

GitHub Event Source

Generating webhook events to demonstrate real-time GitHub integration

GitHub Webhooks

About

Test repository for triggering GitHub webhook events (push, pull request, merge). Works with webhook-repo to demonstrate real-time GitHub integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages