How to Quickly Check Contents of Pull Requests Before Merging with on Windows with GitHub CLI

The aim of this page📝 is to share a little PowerShell wrapper around GitHub CLI I am using daily

The wrapper does 3 steps within a single command:

I am using this as a trust but verify measure when performing releases/rollouts/deployments and I am given a particular Pull Request ID from developers. The prereq of course is that the GitHub CLI is up and running on your machine.

1. NOTES

function mpr($pr_number) {
$pr_number | % {
Write-Host "—— THE DWARVES ARE CHECKING A PR DIFFs ——" -ForegroundColor Darkblue -BackgroundColor DarkYellow
Write-Host "—— VIEW ——" -ForegroundColor DarkCyan
gh pr view $_
Pause
Write-Host "—— DIFFs ——" -ForegroundColor DarkCyan
gh pr diff $_
Pause
Write-Host "—— MERGE ——" -ForegroundColor DarkCyan
gh pr merge $_
}
}

2. LINKS

--

--

Infrastructure Support Engineer/Technical Writer (snowplow.io) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (snowplow.io) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com