GHAWatch — GitHub Actions Workflow Monitor
GHAWatch is a lightweight command-line tool that monitors GitHub Actions workflow runs, jobs, and steps for a given repository and prints updates in real time.
It reports:
- workflow run started / completed
- job started / completed
- step started / completed
One event is printed per line to stdout.
The tool is fault-tolerant, handles GitHub API rate limits, and resumes from where it stopped using a small local JSON state file.
GHAWatch is a lightweight Java CLI tool that monitors GitHub Actions workflow runs, jobs, and steps for a given repository, printing real-time updates to stdout — one line per event. It supports:- Workflow run started / completed- Job started / completed- Step started / completed- Includes timestamps, run/job IDs, step number, branch, SHA, status, and message The tool is fault-tolerant, handles GitHub API rate limits, and resumes from where it stopped using a local JSON state file (~/.gha-watch///state.json).--
Tech Stack
- Java 17 — stable LTS.
- Maven — simple build/dependency management.
- OkHttp — lightweight HTTP client for GitHub API calls.
- Jackson — fast JSON parsing and DTO mapping.
- SLF4J — clean logging with optional verbose mode.
Usage
Build
mvn clean package--
Run
java -jar target/GHAWatch-1.0-SNAPSHOT-jar-with-dependencies.jar <owner/repo>[options]
Example: export GITHUB_TOKEN=ghp_xxx java -jar target/GHAWatch-1.0-SNAPSHOT-jar-with-dependencies.jar actions/starter-workflows --interval 5Anvarjon7/learning-platfrom--interval 5 --verbose --token ghp_xxx--
Options
--interval N Poll interval in seconds (default 10) --token VALUE GitHub token (or use GITHUB_TOKEN env var) --verbose Enable debug logging --state PATH Custom state file path
CLI Options--token--interval
--state--since-seconds--verbose--
Event Format
2025-112025-12-26T1201T14:59:25.099487+01:3400 | JOB_STARTED | repo=owner/repo | run=119823269680 | job=1256790344506 | step=- | branch=main | sha=abc1234c42a342 | status=in_progresscompleted | msg="Job started: build""--
Architecture
- Main — CLI entry point
- GitHubClient — GitHub API wrapper with rate-limit handling
- MonitorEngine — polling loop and event detection
- StateStore — load/save JSON state
- EventEmitter — prints events to stdout
Requirements
- Java 17+
- Maven
- GitHub token with public or repo read access
Java 17+ Maven GitHub token (repo or public_repo or actions:read)
0 commit comments