https://github.com/geertmeersman/github-scripts
Github Dependabot Auto-Merge & Scripts container
https://github.com/geertmeersman/github-scripts
github scripts
Last synced: 5 months ago
JSON representation
Github Dependabot Auto-Merge & Scripts container
- Host: GitHub
- URL: https://github.com/geertmeersman/github-scripts
- Owner: geertmeersman
- License: mit
- Created: 2025-06-07T08:43:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-15T01:00:19.000Z (6 months ago)
- Last Synced: 2026-01-15T07:50:34.870Z (6 months ago)
- Topics: github, scripts
- Language: Python
- Homepage: https://hub.docker.com/repository/docker/geertmeersman/github-scripts
- Size: 193 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://github.com/geertmeersman)
[](https://www.buymeacoffee.com/geertmeersman)
[](https://github.com/geertmeersman/github-scripts/blob/main/LICENSE)
[](https://github.com/geertmeersman/github-scripts/issues)
[](http://isitmaintained.com/project/geertmeersman/github-scripts)
[](http://isitmaintained.com/project/geertmeersman/github-scripts)
[](https://github.com/geertmeersman/github-scripts/pulls)
[](https://github.com/geertmeersman/github-scripts/releases)
[](https://github.com/geertmeersman/github-scripts/releases)
[](https://github.com/geertmeersman/github-scripts/commits)
[](https://github.com/geertmeersman/github-scripts/graphs/contributors)
[](https://github.com/geertmeersman/github-scripts/commits/main)


# 🔄 GitHub Scripts Dashboard
A Dockerized automation suite to manage GitHub workflows like auto-merging Dependabot PRs and sending daily PR reports — complete with a web interface, cron integration, and notifications.
---
## 📆 Overview
This container:
* 🧠 Automatically **merges Dependabot PRs**
* 📧 **Emails you** a daily **PR report** (PRs authored/assigned/mentioning you)
* 🖥️ Exposes a **Flask dashboard** (on port 80) to manually trigger/monitor scripts
* 🔁 Runs on **cron** internally (02:00 and 06:00)
* 📨 Sends **email + Telegram** notifications
* 📌 Logs all activity to `/var/log/github-scripts/`
Built and maintained by [Geert Meersman](https://github.com/gmeersman)
---
## 🧠 Features
| Feature | Description |
| -------------------------- | ------------------------------------------------------ |
| 🔁 Auto-Merge | Merges eligible Dependabot PRs using GitHub API |
| 📧 PR Report Emails | Sends daily HTML summary of PRs authored/assigned/etc. |
| 🖥️ Web UI | Run and view scripts via browser (port 80) |
| 🥐 Cron-Based Execution | Auto-runs at 2:00 and 6:00 UTC |
| 🔔 Email & Telegram Alerts | Optional notifications on success/failure |
| ❤️ Lightweight Container | Based on `python:3.11-slim` |
---
## 📂 File Structure
```
/scripts/github/
├── auto_merge_prs.py # Script: merge PRs
├── report_open_prs.py # Script: send PR report
├── notify_utils.py # Utilities: Email & Telegram
├── report_utils.py # Utilities: HTML report wrapper
├── scripts.json # Metadata for dashboard
/scripts/container/
├── cron_wrapper.py # Wrapper: logs script + error output
├── describe_cron.py # Describes cron jobs at startup
├── healthcheck.sh # Healthcheck used by Docker
/web/
└── web_interface.py # Flask dashboard (port 80)
/cron/
└── cronjob # All cron job entries
/docker-compose/
└── compose.yml # Docker compose config
entrypoint.sh # Starts cron + Flask via Gunicorn
Dockerfile
VERSION
```
---
## ⚙️ Environment Variables (`.env`)
```env
# Web
WEB_PORT=80
# GitHub
GITHUB_USER=
GITHUB_TOKEN=
MERGE_METHOD=squash
# Email (optional)
SMTP_USER=
SMTP_PWD=
SMTP_SERVER=
SMTP_PORT=587
EMAIL_FROM=
EMAIL_TO=
# Telegram (optional)
TELEGRAM_BOT_ID=
TELEGRAM_CHAT_ID=
# Volume path
LOG_VOLUME=
```
---
## 🚪 Running It
### 🔧 Build Image
```bash
docker build -t github-scripts .
```
### 🚀 Run Container
```bash
docker run -d \
--env-file .env \
--name github-scripts \
-p 80:80 \
github-scripts
```
The dashboard will be available at: [http://localhost](http://localhost)
---
## ⏰ Cron Schedule (Inside Container)
| Time (UTC) | Script | Log File |
| ---------- | ----------------------- | -------------------------------------------------------- |
| 02:00 | `auto_merge_prs` | `/var/log/github-scripts/auto_merge_prs_cron.log` |
| 06:00 | `report_open_prs` | `/var/log/github-scripts/report_open_prs_cron.log` |
Each job is executed through `cron_wrapper.py`, which logs stdout and stderr.
---
## 📨 Notifications
* **Email**: Sent using SMTP config (see `.env`)
* **Telegram**: Optional webhook alert for job success/failure
If credentials are missing, notification modules gracefully skip execution.
---
## ♻️ Entrypoint Behavior
On container start:
1. ✅ Environment is dumped to `/env.sh`
2. ⏰ Cron daemon starts
3. 📜 Cron jobs are described via `describe_cron.py`
4. 🌐 Flask app is launched on port `80` using Gunicorn
Logs and errors are automatically routed for cron jobs and can be inspected using:
```bash
docker exec -it github-scripts tail -n 100 /var/log/github-scripts/*.log
```
---
## ✅ Healthcheck
Docker health check runs via `/healthcheck.sh`, which confirms the Flask UI is up.
```bash
curl http://localhost/health
```
---
## 👤 Author
Geert Meersman — [@gmeersman](https://github.com/gmeersman)
MIT License