یه اسکریپت ساده Bash که هر چند ساعت یهبار بهصورت خودکار یه خط متن رندوم به یه فایل اضافه میکنه و اون رو commit و push میکنه به GitHub. نتیجه؟ گراف فعالیت GitHub شما همیشه سبز میمونه 🟩
github-activity-bot/
├── auto_commit.sh ← اسکریپت اصلی
├── setup.sh ← نصب خودکار
├── activity.txt ← فایل متنی (خودکار ساخته میشه)
└── .gitignore
- سیستمعامل Linux یا macOS
- git نصب باشه
- احراز هویت GitHub (SSH یا Personal Access Token)
۱. کلون کن:
git clone git@github.com:USERNAME/github-activity-bot.git
cd github-activity-bot۲. اسکریپت setup رو اجرا کن:
bash setup.shsetup.sh بهصورت تعاملی ازت میپرسه:
- روش احراز هویت (SSH یا Token)
- هر چند ساعت یهبار commit بزنه
همه چیز خودکار تنظیم میشه ✅
# ساخت SSH key
ssh-keygen -t ed25519 -C "your@email.com"
# نمایش public key
cat ~/.ssh/id_ed25519.pubبعد برو GitHub ← Settings ← SSH and GPG keys ← New SSH key و paste کن.
سپس remote رو به SSH تغییر بده:
git remote set-url origin git@github.com:USERNAME/REPO.gitبرو GitHub ← Settings ← Developer settings ← Personal access tokens ← Generate new token
فقط scope مربوط به repo رو تیک بزن، بعد:
git remote set-url origin https://USERNAME:TOKEN@github.com/USERNAME/REPO.gitbash auto_commit.shtail -f /tmp/github_activity_bot.logمشاهده:
crontab -lویرایش یا حذف:
crontab -e| مشکل | راهحل |
|---|---|
Permission denied |
chmod +x auto_commit.sh |
Username/password میخواد |
Remote رو به SSH تغییر بده |
| Push نمیکنه | git remote -v رو چک کن |
| Cron اجرا نمیشه | مطمئن شو مسیر فایل در crontab کامل و درسته |
A simple Bash script that automatically appends a random line to a text file and commits + pushes it to GitHub on a schedule using cron. Result? Your GitHub activity graph stays green 🟩
github-activity-bot/
├── auto_commit.sh ← main script
├── setup.sh ← automated installer
├── activity.txt ← text file (auto-created)
└── .gitignore
- Linux or macOS
- git installed
- GitHub authentication (SSH or Personal Access Token)
1. Clone the repo:
git clone git@github.com:USERNAME/github-activity-bot.git
cd github-activity-bot2. Run the setup script:
bash setup.shThe setup script will interactively ask you:
- Authentication method (SSH or Token)
- How often to commit (every 1h, 2h, 6h, or custom)
Everything is configured automatically ✅
# Generate SSH key
ssh-keygen -t ed25519 -C "your@email.com"
# Copy public key
cat ~/.ssh/id_ed25519.pubGo to GitHub → Settings → SSH and GPG keys → New SSH key and paste it.
Then update your remote:
git remote set-url origin git@github.com:USERNAME/REPO.gitGo to GitHub → Settings → Developer settings → Personal access tokens → Generate new token
Check only the repo scope, then:
git remote set-url origin https://USERNAME:TOKEN@github.com/USERNAME/REPO.gitbash auto_commit.shtail -f /tmp/github_activity_bot.logView:
crontab -lEdit or remove:
crontab -e| Issue | Fix |
|---|---|
Permission denied |
Run chmod +x auto_commit.sh |
| Asks for username/password | Switch remote to SSH |
| Push fails | Check git remote -v |
| Cron doesn't run | Make sure the full path is used in crontab |
MIT