From de21a946044492c9906b3c190baedf2fa41962b0 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 16 Feb 2024 15:13:46 +0100 Subject: [PATCH] github-merge-pr: permit to target other repository name Add support to target other repository name by passing the repository as a 3rd arg to the script. Example: github-merge-pr.sh 23 main ubus Will rebase and merge PR 23 in branch main for repository ubus. Also add additional info on the additional args the script supports. Signed-off-by: Christian Marangi --- github-merge-pr.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/github-merge-pr.sh b/github-merge-pr.sh index e22f3df..7f23435 100755 --- a/github-merge-pr.sh +++ b/github-merge-pr.sh @@ -6,10 +6,14 @@ # 2. Make sure you can correctly push and force push to the github # repository # -# Usage: github-merge-pr.sh PR_NUMBER BRANCH +# Usage: github-merge-pr.sh PR_NUMBER BRANCH REPO_NAME +# +# BRANCH is optional and defaults to main. +# REPO_NAME is optional and defaults to openwrt. It does +# describe the repository name to use to pull PR info from. -# Github repository, just the name/repo part, no .git suffix, no base url! -REPO="openwrt/openwrt" +# Github repository owner or organization name. +GITHUB_REPO_OWNER="openwrt" # Your repository token, generate this token at your profile page: # - Navigate to https://github.com/settings/tokens @@ -23,8 +27,11 @@ REPO="openwrt/openwrt" PRID="$1" BRANCH="${2:-main}" -DRY_RUN="$3" +GITHUB_REPO_NAME="${3:-openwrt}" +DRY_RUN="$4" + GIT=git +REPO="$GITHUB_REPO_OWNER"/"$GITHUB_REPO_NAME" yesno() { local prompt="$1" -- 2.30.2