An automated GitHub commit and activity scheduler designed for PowerShell. It helps maintain a consistent GitHub contribution streak by automating commits with randomized counts, realistic intervals, and seamless background execution via Windows Task Scheduler.
- 🎲 Randomized Activity: Generates between 2 to 7 commits per execution to mimic natural commit patterns.
- ⏱️ Realistic Delays: Random sleep intervals (5–30 seconds) between successive commits.
- 🔑 Headless GitHub CLI Auth: Dynamically retrieves authentication tokens using
gh auth token, eliminating Task Scheduler credential helper failures (could not read Username). - 🔄 Auto Rebase & Sync: Automatically runs
git pull --rebase --autostashbefore committing to avoid push conflicts. - 📜 Full Transcript Logging: Generates runtime logs (
auto-commit.log) without polluting git history. - 🛡️ Per-Commit Pushing: Pushes each commit immediately so contributions are synced even if the process is terminated early.
- Changes directory to the script's root path.
- Initializes transcript logging to
auto-commit.log. - Injects a non-interactive Git credential helper backed by
gh auth token. - Pulls remote updates and pushes any pending local commits.
- Loops through a randomized commit count (
$2 \le n \le 7$ ):- Appends a timestamped record to
commit-log.txt. - Stages and commits changes with
update: <timestamp>. - Pushes to the
mainbranch. - Sleeps for a random duration (
$5 - 30\text{ seconds}$ ) between iterations.
- Appends a timestamped record to
- Windows 10 / 11 with PowerShell 5.1+ or PowerShell 7+
- Git for Windows installed and available in
PATH - GitHub CLI (
gh) authenticated:gh auth login
To run the script automatically every day:
- Open Task Scheduler (
taskschd.msc). - Click Create Basic Task...
- Set the trigger to Daily and choose your preferred execution time.
- Set Action to Start a program:
- Program/script:
powershell.exe - Add arguments:
-ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Path\To\commit-O\auto-commit.ps1" - Start in:
C:\Path\To\commit-O
- Program/script:
- Finish and save the task.
MIT License. Free to use and customize.