From d311fedfbc9634d70660dd0e465ca8c045e5b65e Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Tue, 29 Jun 2021 10:18:00 -0400 Subject: [PATCH] Script to find any PR affecting a single file --- tools/pr_affecting_file.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tools/pr_affecting_file.sh diff --git a/tools/pr_affecting_file.sh b/tools/pr_affecting_file.sh new file mode 100644 index 0000000..f3680d2 --- /dev/null +++ b/tools/pr_affecting_file.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +curl -s https://api.github.com/repos/lnbook/lnbook/pulls | jq '.[]|.number' | while read pr; do + git fetch --quiet github refs/pull/$pr/head + if git show --pretty=format:'' --name-only FETCH_HEAD | grep -q $1; then + echo "PR $pr" + fi +done