From patchwork Sat Jul 6 16:07:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1957618 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=sPtE7aIV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=qjiC5YtG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WGb1N1GwNz1xr7 for ; Sun, 7 Jul 2024 02:09:26 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8u54LoCslcy4sNFeFE2lKHq20xPNZmiLGtiPApXyQys=; b=sPtE7aIVviuTox P+mNqyaLpEaSHLDzSNvkvN5BP89nzUNj1yvmlbbRaO3f6VdWNjp4yZIHyXDa8oqlSDfDCwV7Ca/5T jC6wK8GO7zoN67hto1QaBZcjEAy/1o5IDIZiW3C/RFodzt2s7u6YTVEdyKdoutMsY/Q9i5yAGX7UR or/fPuUANFrVBwLvDmLtJ8RhOtr1/bTKFsMAdFwIqD7DeAlaCe5EXoNJ/fHPfmltQD9BGv6gv9odt NfjcF9LxtCEgML3zaSVwzTFQbfPirx5ZpAOPNgCseaMpJT36X9w7LSnxTyi9HAF2HVmxBPKweMlXq NBnLWMGSsh5709/kWtYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQ7x7-00000000R8D-3Msa; Sat, 06 Jul 2024 16:07:57 +0000 Received: from mout-p-201.mailbox.org ([80.241.56.171]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQ7x4-00000000R6e-0RuP for openwrt-devel@lists.openwrt.org; Sat, 06 Jul 2024 16:07:55 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4WGZzQ2kTnz9t3d; Sat, 6 Jul 2024 18:07:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1720282066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mOKcaM65LUpqmENxz+wlwNadc+iB7jyyojyLNjlsHMM=; b=qjiC5YtGD62GsPFb5C10ZlrirNvkdggdqe7hhyj+0u4OEz9fHa/4GclzZVypGs/pSE6Frs /8AKSYxOkjHxUa6ZT43XE4qLbTyOvCd34ZEsHShiag0lELE21nI4cIiiKzhk/ICq95mjM4 5qoKFabUFZuCoW/Q5DgV2wHhTqnkFKdwq8a7LFqpZQ3QOqx0D+z/nRN8uHpv9GX1L5S6Jp kDe+RSWtfuWnPi3xCoTPgD4vdklvxEHLwmFzZFhPJo5h2A8E6GUTaXMZkhhNx6cytFzWTA aod5X/p0cXUfW+1RqpF8ldOMsvkEfzPHfDwedPi98TQnxLJH8ftVhMQqlIBDmA== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: ansuelsmth@gmail.com, Hauke Mehrtens Subject: [maintainer-tools PATCH 2/4] github-merge-pr: Add option for no remote operations Date: Sat, 6 Jul 2024 18:07:23 +0200 Message-ID: <20240706160725.3257906-3-hauke@hauke-m.de> In-Reply-To: <20240706160725.3257906-1-hauke@hauke-m.de> References: <20240706160725.3257906-1-hauke@hauke-m.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240706_090754_313530_DADDEA70 X-CRM114-Status: UNSURE ( 6.54 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This adds the new option GITHUB_NO_PUSH which will prevent the script from doing any changes to remote repositories. Signed-off-by: Hauke Mehrtens --- github-merge-pr.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.171 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This adds the new option GITHUB_NO_PUSH which will prevent the script from doing any changes to remote repositories. Signed-off-by: Hauke Mehrtens --- github-merge-pr.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/github-merge-pr.sh b/github-merge-pr.sh index db49c92..76aec20 100755 --- a/github-merge-pr.sh +++ b/github-merge-pr.sh @@ -158,6 +158,21 @@ if [ "$(echo "$PR_INFO" | jq -r ".maintainer_can_modify")" == "true" ]; then exit 9 fi + if [ "$GITHUB_NO_PUSH" = "1" ]; then + echo "next commands:" + if [ "$(echo "$PR_INFO" | jq -r ".maintainer_can_modify")" == "true" ]; then + echo "$GIT push $PR_USER HEAD:$PR_BRANCH --force" + echo "$GIT checkout $BRANCH" + echo "$GIT merge --ff-only $PR_USER/$PR_BRANCH" + else + echo "$GIT checkout $BRANCH" + echo "$GIT merge --ff-only $LOCAL_PR_BRANCH" + fi + echo "$GIT push" + echo "$GIT branch -D $LOCAL_PR_BRANCH" + exit 20 + fi + echo "Force pushing $LOCAL_PR_BRANCH to HEAD:$PR_BRANCH for $PR_USER" if ! $GIT push $PR_USER HEAD:$PR_BRANCH --force; then echo "Failed to force push HEAD to $PR_USER" >&2