A comprehensive webhook-based automation bot that integrates GitHub, Jira, and Microsoft Teams to streamline developer workflows and team communication.
This project is a Final Year Project demonstrating real-world DevOps automation by connecting multiple platforms:
- GitHub - Code repository management
- Jira - Issue tracking and project management
- Microsoft Teams - Team communication and notifications
The bot automatically sends notifications, generates reports, and monitors project health - reducing manual tracking and improving team visibility.
- PR Creation/Updates: Instant notifications when pull requests are opened, closed, or merged
- Review Requests: Alerts when someone is assigned as a reviewer with file change details
- Review Submissions: Notifications for approvals, change requests, and comments
- Ticket Created/Updated: Real-time alerts for new Jira tickets
- Assignment Tracking: Notifications when tickets are assigned
- Status Changes: Updates when tickets move through workflow states
- Scheduled Reports: Automatically sent every Monday at 9:00 AM
- Manual Reports: Trigger via API endpoint for on-demand generation
- Contributor Activity: Shows PRs merged, issues closed, and pending work per developer
- Automatic Detection: Identifies PRs open for more than 1 day without activity
- Daily Checks: Runs every day at 10:00 AM
- Manual Trigger: Test endpoint available for immediate checking
- Web Dashboard: Generate and send reports via email
- PDF Generation: Professional PDF reports with formatted content
- Multiple Recipients: Send to multiple emails (comma-separated)
- Individual or Team: Send to specific contributor or entire team
- Automatic Generation: Uses OpenAI GPT to summarize code changes
- Smart Analysis: Analyzes PR title, description, and file changes
- Concise Reports: 1-2 sentence summaries for quick understanding
- Smart Selection: Automatically assigns the best reviewer based on code expertise
- Commit History Analysis: Finds who has contributed most to the changed files
- Workload Balancing: Considers current review load to distribute work fairly
- Fallback Strategy: Uses recent contributors if no file-specific experts found
- Teams Notification: Posts assignment details with reasoning to Teams channel
- Microsoft Teams: Rich MessageCard format with structured information
- Power Automate Integration: Workflow automation support
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ GitHub │────▶│ │────▶│ Microsoft │
│ Webhooks │ │ Express Server │ │ Teams Channel │
└─────────────────┘ │ (Port 3000) │ └─────────────────┘
│ │
┌─────────────────┐ │ • GitHub API │ ┌─────────────────┐
│ Jira │────▶│ • Jira API │────▶│ Teams Webhook │
│ Webhooks │ │ • Cron Jobs │ │ (Power Automate)│
└─────────────────┘ │ • Auto-Reviewer │ └─────────────────┘
└──────────────────┘
│
▼
┌──────────────────┐
│ Scheduled Jobs │
│ • Weekly Report │
│ • Stale PR Check│
└──────────────────┘
FinalYear-Git-agent/
│
├── webhookServer.js # Main Express server with all endpoints
├── GithubService.js # GitHub API service functions
├── mcpServer.js # Model Context Protocol server
├── server.js # Alternative server entry point
├── reportService.js # Report generation service
├── teamsService.js # Microsoft Teams integration service
├── reportGenerator.cjs # Report generator utility
├── weeklyBot.cjs # Weekly bot automation
├── githubservice-bot.cjs # GitHub service bot utilities
├── test.js # Test utilities
├── package.json # Dependencies and scripts
├── .env # Environment variables (not in git)
├── userMap.json # Maps Teams users to GitHub usernames
├── reports/ # Generated PDF reports directory
│
└── README.md # This documentation file
| Technology | Purpose |
|---|---|
| Node.js | Runtime environment |
| Express.js | Web server and API endpoints |
| Axios | HTTP client for API calls |
| node-cron | Scheduled job automation |
| GitHub API | Repository data fetching |
| Jira Webhooks | Issue tracking integration |
| Microsoft Teams | Communication platform |
| OpenAI API | AI-powered PR summaries |
| PDFKit | PDF report generation |
| Nodemailer | Email delivery |
| ngrok | Local tunnel for webhook testing |
- Node.js 18+ installed
- GitHub account with repository access
- Jira account with admin access
- Microsoft Teams with webhook permissions
- ngrok account (for local development)
# Clone repository
git clone <your-repo-url>
cd FinalYear-Git-agent
# Install dependencies
npm installCreate .env file:
PORT=3000
GITHUB_TOKEN=ghp_your_github_personal_access_token
REPO_OWNER=your-github-username
REPO_NAME=your-repo-name
TEAMS_WEBHOOK=https://your-teams-webhook-url
TEAMS_WEBHOOKBOT=https://optional-second-webhook-url
# Optional: AI-Powered PR Summaries
OPENAI_API_KEY=sk-your-openai-api-key
# Optional: Email Reports (Gmail)
GMAIL_USER=your-email@gmail.com
GMAIL_PASS=your-app-passwordGet GitHub Token:
- Go to GitHub → Settings → Developer settings → Personal access tokens
- Generate new token with
reposcope - Copy token to
.env
Get Teams Webhook:
- In Teams, go to channel → Connectors → Incoming Webhook
- Create webhook and copy URL to
.env
# Development mode (auto-restart on changes)
npm run dev
# Production mode
npm start# Install ngrok if not already installed
# Start ngrok
ngrok http 3000
# Copy the HTTPS URL (e.g., https://abc123.ngrok.io)- Go to your GitHub repository → Settings → Webhooks
- Click Add webhook
- Payload URL:
https://your-ngrok-url/ - Content type:
application/json - Events to subscribe:
- Pull requests
- Pull request reviews
- Click Add webhook
- Go to Jira → System → Webhooks
- Click Create a WebHook
- Name: Teams Bot Webhook
- URL:
https://your-ngrok-url/jira - Events:
- Issue → created
- Issue → updated
- Click Create
| Endpoint | Method | Description |
|---|---|---|
/ |
POST | GitHub webhook receiver |
/jira |
POST | Jira webhook receiver |
/weekly |
POST | Generate manual weekly report |
/stale-prs |
GET/POST | Check for stale PRs manually |
/dashboard |
GET | Web dashboard for email reports |
/send-report |
POST | Generate and email PDF report |
curl -X POST http://localhost:3000/weekly \
-H "Content-Type: application/json" \
-d '{"from": "Swetha S", "mentions": [{"name": "Manager"}]}'# Via browser
curl http://localhost:3000/stale-prs
# Via Postman
POST http://localhost:3000/stale-prs| Job | Schedule | Description |
|---|---|---|
| Weekly Report | Every Monday 9:00 AM | Sends contributor activity report |
| Stale PR Check | Every day 10:00 AM | Alerts for inactive PRs |
👀 REVIEW REQUESTED
@swetha
PR #42: "Fix login bug"
Author: @srinithivadivelu
Files changed: 3 files (+120, -45)
Review now: https://github.com/...
WEEKLY DEVELOPER REPORT
Monday, March 27, 2026
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
**Srinithi**
- Fixed login bug
- Updated API docs
Merged: 2 PRs | Raised: 1 PR
**Swetha**
Merged: 3 PRs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Generated by GitHub Weekly Report Bot
STALE PR ALERT
These PRs haven't been updated in 1+ days:
PR #42 - "Database migration" by @arun (5 days old)
Link: https://github.com/...
Please review or merge them!
🤖 AUTO-REVIEWER ASSIGNED
PR #42: "Fix login bug"
Author: @srinithi
👤 ASSIGNED REVIEWER: @swetha
📊 SELECTION CRITERIA:
Expertise: 15 pts | 2 pending reviews (adjusted)
📁 FILES CHANGED: 3 files (+120, -45)
🔍 FILE EXPERTISE ANALYSIS:
• src/auth/login.js: @swetha(8), @arun(3)
• src/utils/validator.js: @swetha(5), @john(2)
• tests/auth.test.js: @swetha(4), @mary(2)
💡 Why this reviewer?
This person has significant experience with the code being modified, making them ideal to provide valuable feedback while maintaining code quality standards.
Review now: https://github.com/...
Morning (9:00 AM)
- Weekly report automatically posts to #engineering-updates
- Manager sees Swetha completed 3 PRs, Srinithi has 1 pending
During Work
- Srinithi creates PR #42 → Bot analyzes changed files
- Auto-reviewer assigns Swetha (most expertise in auth module)
- Teams posts assignment with reasoning (file expertise analysis)
- Swetha approves PR → Srinithi gets confirmation
Daily (10:00 AM)
- Stale PR check runs
- Alerts team about 2 PRs sitting for 5 days
- Manager follows up with developers
Jira Activity
- New ticket created → Auto-posted to Teams
- Ticket assigned → Developer gets notification
- Status changes → Everyone stays updated
- Never commit
.envfile - contains sensitive tokens - Rotate GitHub tokens regularly (every 90 days)
- Use ngrok only for development - production should use proper hosting
- Validate webhook signatures in production environments
- Check ngrok is running and URL is updated in GitHub/Jira
- Verify webhook secret (if configured)
- Check server logs for errors
- Verify TEAMS_WEBHOOK URL in
.env - Check webhook is still active in Teams
- Test with manual curl request
- Token may be expired - generate new one
- Ensure token has
reposcope - Check REPO_OWNER and REPO_NAME are correct
- Auto-Reviewer Assignment - Intelligently assigns reviewers based on code expertise
- CI/CD Build Status Notifications
- Sprint Velocity Analytics
- Sentiment Analysis on Comments
- Multi-Repository Support
- Web Dashboard with Charts
- Slack/Discord Integration
- AI-Powered Insights
The auto-reviewer feature uses a sophisticated scoring system to select the best reviewer:
-
File Analysis
- Fetches all files changed in the PR
- Limits to first 10 files for performance
-
Expertise Calculation
- Queries commit history for each changed file
- Counts commits per author over last 30 commits
- Weights files by change type (added=1.5x, modified=1.0x, deleted=0.8x)
-
Workload Balancing
- Counts pending reviews for each candidate
- Applies penalty factor: >3 pending = 0.3x, >1 pending = 0.7x
-
Composite Score
Score = Expertise × Workload_Penalty -
Selection
- Highest composite score wins
- Fallback to recent contributors if no file experts found
| Reviewer | Expertise | Pending Reviews | Penalty | Final Score |
|---|---|---|---|---|
| @swetha | 15 | 2 | 0.7 | 10.5 ✓ |
| @arun | 12 | 0 | 1.0 | 12.0 ✓ |
| @john | 8 | 4 | 0.3 | 2.4 |
In this case, @arun would be selected despite lower expertise because @swetha has a heavy workload.
Type: Final Year Engineering Project Institution: Sri Ramakrishna Engineering College Developer: Swetha Sivananaitha Perumal Year: 2026
This project demonstrates:
- REST API integration (GitHub, Jira, Teams)
- Webhook-based event handling
- Scheduled automation using cron jobs
- Real-world DevOps practices
- Full-stack development skills
This project is for educational purposes only.
For questions or issues, contact:
- Email: swetha.2201238@srec.ac.in
- GitHub: github.com/Swetha-160303