Sign inSign up

geertmeersman/github-scripts

By geertmeersman

•Updated 2 months ago

A Dockerized Flask web interface to manage automated GitHub scripts

Image
Integration & delivery
Developer tools
Monitoring & observability
0

2.7K

geertmeersman/github-scripts repository overview

maintainer GitHub Repo buyme_coffee

ā šŸ”„ 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⁠


⁠🧠 Features

FeatureDescription
šŸ” Auto-MergeMerges eligible Dependabot PRs using GitHub API
šŸ“§ PR Report EmailsSends daily HTML summary of PRs authored/assigned/etc.
šŸ–„ļø Web UIRun and view scripts via browser (port 80)
🄐 Cron-Based ExecutionAuto-runs at 2:00 and 6:00 UTC
šŸ”” Email & Telegram AlertsOptional notifications on success/failure
ā¤ļø Lightweight ContainerBased on python:3.11-slim

ā šŸ“‚ File Structure

/scripts/github/
ā”œā”€ā”€ auto_merge_dependabot.py     # Script: merge dependabot 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)

# Web
WEB_PORT=80

# GitHub
GITHUB_USER=<your-github-user>
GITHUB_TOKEN=<your-token>
MERGE_METHOD=squash

# Email (optional)
SMTP_USER=<your-user>
SMTP_PWD=<your-password>
SMTP_SERVER=<smtp-server>
SMTP_PORT=587
EMAIL_FROM=<email-from>
EMAIL_TO=<email-to>

# Telegram (optional)
TELEGRAM_BOT_ID=<your-bot-id>
TELEGRAM_CHAT_ID=<your-chat-id>

# Volume path
LOG_VOLUME=<path-for-log-mount>

⁠🚪 Running It

ā šŸ”§ Build Image
docker build -t github-scripts .
ā šŸš€ Run Container
docker run -d \
  --env-file .env \
  --name github-scripts \
  -p 80:80 \
  github-scripts

The dashboard will be available at: http://localhost⁠


ā ā° Cron Schedule (Inside Container)

Time (UTC)ScriptLog File
02:00auto_merge_dependabot/var/log/github-scripts/auto_merge_dependabot_cron.log
06:00report_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:

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.

curl http://localhost/health

ā šŸ‘¤ Author

Geert Meersman — @gmeersman⁠

MIT License

Tag summary

Content type

Image

Digest

sha256:19112224f…

Size

84 MB

Last updated

2 months ago

docker pull geertmeersman/github-scripts