From: Christian Marangi Date: Mon, 29 Apr 2024 10:22:37 +0000 (+0200) Subject: github-merge-pr: use --force for filter-repo commands X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=db54a345e510b88f7f0f6623428f5198efe50396;p=maintainer-tools.git github-merge-pr: use --force for filter-repo commands Use --force for filter-repo commands to handle special branch merged by Committer that wouldn't be fresh copy as required by filter-repo commands. Signed-off-by: Christian Marangi --- diff --git a/github-merge-pr.sh b/github-merge-pr.sh index b2c94b5..4a61a3f 100755 --- a/github-merge-pr.sh +++ b/github-merge-pr.sh @@ -123,7 +123,7 @@ if [ "$(echo "$PR_INFO" | jq -r ".maintainer_can_modify")" == "true" ]; then # Add to each commit Link: https://github.com/$REPO/pull/$PRID if ! $GIT filter-repo --message-callback " return message + b\"Link: https://github.com/$REPO/pull/$PRID\" - " --refs $BRANCH..$LOCAL_PR_BRANCH; then + " --refs $BRANCH..$LOCAL_PR_BRANCH --force; then echo "Failed to add Link: Pull Request tag" >&2 exit 9 fi @@ -131,7 +131,7 @@ if [ "$(echo "$PR_INFO" | jq -r ".maintainer_can_modify")" == "true" ]; then # Remove any previous SoB tag if the Pull Request Author and Committer match if ! $GIT filter-repo --message-callback " return message.replace(b\"Signed-off-by: $(git config user.name) <$(git config user.email)>\",b\"\") - " --refs $BRANCH..$LOCAL_PR_BRANCH; then + " --refs $BRANCH..$LOCAL_PR_BRANCH --force; then echo "Failed to remove previous Committer SoB tag" >&2 exit 9 fi