Last active
November 7, 2025 08:44
-
-
Save tklauser/9b0c1897bfaf16bd18bd956b6fd1f18e to your computer and use it in GitHub Desktop.
Find out which PR introduced a commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| if [[ "$#" -ne 1 ]]; then | |
| echo "Usage: $0 <SHA>" | |
| fi | |
| SHA=$1 | |
| # see gh pr list --help for JSON fields and gh help formatting for template formatting options | |
| gh pr list --search ${SHA} --state merged --json title,url,mergedAt --template \ | |
| '{{range .}}{{.url}} {{.title | autocolor "green"}} (merged {{(timeago .mergedAt)}}){{"\n"}}{{end}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment