Workshop · GitHub CLI
Auto PR Mass Merge
The same mass-merge.ps1 used live during Git & GitHub 101 on Arlovzki/git-github-101. Co-leads with Collaborator Write can clear attendee PR waves without Admin auto-merge.
Runs locally in PowerShell using your GitHub CLI account.
Quick start
- Install GitHub CLI and run
gh auth login - Download
mass-merge.ps1 - Open PowerShell in the download folder and preview your repository:
.\mass-merge.ps1 -Repo owner/name -DryRun - Review the preview, then run:
.\mass-merge.ps1 -Repo owner/name -Watch
# Default repo: Arlovzki/git-github-101 .\mass-merge.ps1 -Watch -IntervalSeconds 10 # Point at another workshop repo .\mass-merge.ps1 -Repo owner/name -Watch
Proven in session
On 5 Sep 2026 this script helped clear the workshop PR queue for about 20–40 participants on Arlovzki/git-github-101— ending with 22 closed PRs after the session. Attendee "add yourself" PRs were squash-merged live while learners finished the fork → branch → PR loop from the workshop site.
See it in use
Before and during the session, the script was verified on the same repo — watch mode picked up a test PR (#3 KurtAxcel_mass-merge-test01) and squash-merged it as devkurtaxcel (Collaborator Write).
What you need
- Workshop co-leads / helpers who can merge but lack Admin auto-merge toggles
- Sessions with roughly 20–40 participants sending "add yourself" PRs at once
- Not a bypass for zero write access — GitHub still requires merge permission
vs GitHub auto-merge
| Approach | Needs | Best when |
|---|---|---|
| Repo auto-merge / Actions | Admin + Actions settings | Owner prep before the session |
| This script | Write + GitHub CLI | Live wave — co-lead runs watch mode |
What the script changes
- Only merges PRs whose changed files are all under
attendees/ - Skips conflicts and appends them to
merge-conflicts.log - Squash merge + delete head branch — no checkout, amend, or push to contributor branches
- Retry with backoff on transient API failures
Credits
Script authored and run in-session by Kurt Axcel Peñano (AWS SBG – Spade | SkillBuilder Co-lead) for Arlou A. Beloria's Git & GitHub 101 workshop. Shared here so other facilitators can reuse the same Write-access path. Source: github.com/devkurtaxcel/Auto-PR-Mass-Merge.