github-merge-pr: remove newline on removing SoB from committer
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 29 Apr 2024 21:26:11 +0000 (23:26 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 29 Apr 2024 21:26:11 +0000 (23:26 +0200)
Remove newline on removing SoB from committer if necessary to keep
commit description tags tidy.

Fixes: c1f80d0258a7 ("github-merge-pr: add Link: tag and Committer SoB")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
github-merge-pr.sh

index 64cd6bff1046c236d4f4c0e0ba0fa0b240653490..16a661d2fb4fb28406ddb825e651be2015f526aa 100755 (executable)
@@ -137,7 +137,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\"\")
+               return message.replace(b\"Signed-off-by: $(git config user.name) <$(git config user.email)>\n\",b\"\")
        " --refs $BRANCH..$LOCAL_PR_BRANCH --force; then
                echo "Failed to remove previous Committer SoB tag" >&2
                exit 9