From c0e1dd72dae6f93abc088471ca23167839551722 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 8 Oct 2018 20:42:10 -0400 Subject: [PATCH] [CI-SKIP] Update checkout-pr Supports usage on any github repo now --- scripts/checkoutpr.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkoutpr.sh b/scripts/checkoutpr.sh index 1328eb582..f11b89a31 100755 --- a/scripts/checkoutpr.sh +++ b/scripts/checkoutpr.sh @@ -3,7 +3,8 @@ if [ -z "$1" ]; then echo "$0 " exit 1; fi -data=$(curl -q https://api.github.com/repos/PaperMC/Paper/pulls/$1 2>/dev/null) +repo=$(git remote get-url origin | sed -E 's/github.com(:|\/)//g') +data=$(curl -q https://api.github.com/repos/$repo/pulls/$1 2>/dev/null) url=$(echo -e "$data" | grep --color=none ssh_url | head -n 1 |awk '{print $2}' | sed 's/"//g' | sed 's/,//g') ref=$(echo -e "$data" | grep --color=none '"head":' -A 3 | grep ref | head -n 1 |awk '{print $2}' | sed 's/"//g' | sed 's/,//g') prevbranch=$(\git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')