Get GitHub PR Number from Current Branch Last updated on June 3, 2025 by Sal Ferrarello When scripting a task using the GitHub CLI, I found I needed the Pull Request (PR) number for my current branch (technically my current commit). I was able to use “gh pr view” to get the information.