中文文档 | English
Automatically track all your open Pull Requests across GitHub repositories with daily markdown reports.
- ✅ Automatically track all your open PRs
- 📊 Display PR status (Review status, CI status)
- 📅 Record creation time and last update time
- 📝 Generate readable markdown format reports
- 🔗 Maintain symlink pointing to latest report
- ⏰ Support scheduled automation via cron
- ☁️ Support GitHub Actions cloud automation
This project offers two usage methods:
Advantages:
- ✅ No local machine needed, runs on GitHub cloud
- ✅ Auto-commits reports to repo for online viewing
- ✅ Leverage Git version control for history
- ✅ Access from anywhere, no local dependencies
- ✅ No cron configuration needed
Setup Steps:
- Fork or create this repo to your GitHub account
- Push code to GitHub (including
.github/workflows/track-prs.yml) - GitHub Actions will auto-enable and run daily at UTC 1:00 (9:00 AM Beijing Time)
- Can also manually trigger from GitHub repo's Actions page
View Reports:
- Visit your repo and open
reports/latest.md - Or view historical reports:
reports/my-open-prs-YYYY-MM-DD.md
Advantages:
- ✅ Full local control
- ✅ No GitHub repo needed
- ✅ Customizable run schedule
Use Case: If you want to run on local machine or don't want to commit reports to GitHub
See "Local Cron Setup" section below for details.
Since cross-repository PR search is required, you need to create a Personal Access Token (PAT).
Steps:
-
Visit GitHub Token Settings:
- Open https://github.com/settings/tokens
- Or: GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
-
Create New Token:
- Click "Generate new token" → "Generate new token (classic)"
- Note: Enter
PR Trackeror other description - Expiration: Recommend
No expirationor1 year
-
Select Permissions (Scopes):
- ✅
repo- Access all repositories (including private repo PRs)- If only public repos needed, select only
public_repo
- If only public repos needed, select only
- ✅
read:org- Read organization info (optional, if you have PRs in organizations)
- ✅
-
Generate and Copy Token:
- Click "Generate token"
- Important: Copy token immediately (only shown once)
- Format looks like:
ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
Add Token to Repo Secrets:
- In your GitHub repo page, go to Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
GH_PAT - Value: Paste the token you just copied
- Click "Add secret"
-
Create GitHub Repository:
# If you don't have a git repo yet, initialize one cd ~/pr-tracker git init git add . git commit -m "Initial commit: PR tracker with GitHub Actions"
-
Push to GitHub:
# Create a new repo on GitHub, then: git remote add origin https://github.com/YOUR_USERNAME/pr-tracker.git git branch -M main git push -u origin main -
Done! GitHub Actions will automatically:
- Run daily at UTC 1:00 (9:00 AM Beijing Time)
- Generate PR reports
- Auto-commit to
reports/directory
- Visit your repo:
https://github.com/YOUR_USERNAME/pr-tracker - Click "Actions" tab
- Select "Track My PRs" workflow
- Click "Run workflow" button
Edit the cron expression in .github/workflows/track-prs.yml:
on:
schedule:
- cron: '0 1 * * *' # UTC 1:00 = 9:00 AM Beijing Time
# Change to other times, for example:
# - cron: '0 9 * * *' # UTC 9:00 = 5:00 PM Beijing TimeCommon Time Conversions (Beijing Time = UTC + 8):
- 9:00 AM Beijing →
cron: '0 1 * * *' - 6:00 PM Beijing →
cron: '0 10 * * *' - Midnight Beijing →
cron: '0 16 * * *'
Symptom: Action fails with authentication or permission errors
Solution:
- Confirm PAT is created (see "Prerequisites" above)
- Check PAT permissions include
reposcope - Confirm
GH_PATis correctly added to repo secrets - Check if token has expired
Possible Causes:
- Insufficient token permissions (need
repoorpublic_repo) - Only public repo PRs will be found (if using
public_repo) - PR count exceeds limit (default 100)
- Visit repo's "Actions" tab
- Click on recent workflow run
- View detailed logs to troubleshoot
- macOS or Linux
- GitHub CLI (gh) installed and authenticated
- Bash shell
macOS:
brew install ghLinux: See official documentation
gh auth logincd ~/pr-tracker
./setup-pr-tracker.shThe setup script will:
- Check dependencies (gh CLI)
- Let you choose run time (9 AM, 6 PM, midnight, or custom)
- Configure cron scheduled task
- Display configuration summary
During setup you can choose:
- Daily at 9:00 AM
- Daily at 6:00 PM
- Daily at midnight
- Custom cron expression
Before configuring scheduled task, you can manually run the script to test:
./track-my-prs.sh~/pr-tracker/
├── track-my-prs.sh # Main script
├── setup-pr-tracker.sh # Setup script
├── README.md # Documentation
├── cron.log # Cron task log
└── reports/ # Report output directory
├── my-open-prs-2025-11-06.md
├── my-open-prs-2025-11-07.md
└── latest.md # Symlink pointing to latest report
# Open Pull Requests for @username
**Generated:** 2025-11-06 09:00:00 CST
---
## Summary
- **Total Open PRs:** 3
- **User:** @username
---
## Pull Requests
### [openshift/hypershift#7131](https://github.com/openshift/hypershift/pull/7131)
**test(e2e): add N-3 and N-4 release image flags**
| | |
|---|---|
| 📝 **Review Status** | ✅ Approved |
| 🔧 **CI Status** | ✅ Passing |
| 📅 **Created** | 2025-11-05 14:23 |
| 🔄 **Last Updated** | 2025-11-06 08:45 |
---crontab -lcrontab -ecrontab -e
# Delete the line containing 'track-my-prs.sh'cat ~/pr-tracker/cron.log-
Check if cron is set:
crontab -l | grep track-my-prs -
Check cron logs:
tail -f ~/pr-tracker/cron.log -
Manually run script to see errors:
cd ~/pr-tracker ./track-my-prs.sh
If you encounter authentication errors:
gh auth status
gh auth refresh
# Or re-login
gh auth loginEnsure scripts have execute permissions:
chmod +x ~/pr-tracker/track-my-prs.sh
chmod +x ~/pr-tracker/setup-pr-tracker.shDefault queries up to 100 PRs. To modify the limit, edit track-my-prs.sh:
--limit 100 # Change to your desired numberTo only track PRs from specific organization (e.g., openshift), modify the search command in track-my-prs.sh:
gh search prs \
--author="${GITHUB_USER}" \
--state=open \
org:openshift \ # Add this line
--json number,title,url,repository,createdAt,updatedAt,reviewDecision,statusCheckRollup \
--limit 100-
Remove cron task:
crontab -l | grep -v "track-my-prs.sh" | crontab -
-
(Optional) Delete entire directory:
rm -rf ~/pr-tracker
If you want to version control your PR reports:
cd ~/pr-tracker
git init
git add track-my-prs.sh setup-pr-tracker.sh README.md
git commit -m "Initial commit"
# Optional: Add .gitignore to exclude cron.log
echo "cron.log" > .gitignore
git add .gitignore
git commit -m "Add gitignore"# List all reports
ls -lh ~/pr-tracker/reports/
# View specific date report
cat ~/pr-tracker/reports/my-open-prs-2025-11-06.md
# View latest report
cat ~/pr-tracker/reports/latest.mdMIT
Issues and Pull Requests are welcome!