- docker
- docker-compose
Before running the project, create a .env
file and define the following variables:
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
GITHUB_TOKEN=your_github_token
MATTERMOST_BOT_TOKEN=your_mattermost_bot_token
MATTERMOST_SERVER_URL=http://your_mattermost_server
JWT_SECRET=your_jwt_secret
CRON_SCHEDULE='0 8-18 * * 1-5' # every hour on weekdays 8am-6pm
Variable details:
GITHUB_TOKEN
: GitHub Personal Access TokenJWT_SECRET
: secret key for generating JWT tokensCRON_SCHEDULE
: check interval for notifications (default: 1 minute)MATTERMOST_BOT_TOKEN
: token for the review botMATTERMOST_SERVER_URL
: domain of the Mattermost server
This project consists of the following components:
- Monitors PRs and workflow status of specified repositories via the GitHub API
- Key features:
- Detects PR create/update/review/merge events
- Monitors GitHub Actions workflow results
- Stores all events in a PostgreSQL database
- Sends notifications to Mattermost based on events saved in the database
- Notification types:
- New PR creation
- PR code updates
- PR reviews
- PR merge completion
- GitHub Actions build failures
- Stores event data
- Tables:
github_repositories
: repositories to monitorpr_events
: PR-related eventspr_reviews
: PR review informationgithub_action_events
: GitHub Actions resultscrawler_status
: crawler status informationmattermost_channels
: Mattermost channel data (channel_type
differentiates PR and CI/CD channels)
- Provides a REST API for the database
- API documentation via Swagger UI
- Runs crawling and notification tasks according to
CRON_SCHEDULE
-
PR Notifications:
- 🆕 New PR created
- 📝 PR code updated
- 💬 Comment from PR author
- 👀 PR review (✅ approve, ❌ request changes, 💭 comment)
- 🎉 PR merged
-
GitHub Actions Notifications:
- ❌ CI/CD build failed
- Only the latest workflow result for each PR is considered. If a newer run succeeds, previous failures are ignored.
# Start the project
docker-compose up -d
# Initialize the DB or apply schema changes
docker-compose run --rm db-init
# View logs
docker-compose logs -f
# Stop the project
docker-compose down
- Swagger UI: http://localhost:8080
- PostgREST API: http://localhost:3002
For the original Korean documentation, see README.kr.md.