From bf5a56d9688f45fe80d6396143e4fea1bc77186e Mon Sep 17 00:00:00 2001 From: Simon Ungar Felding <45149055+simonfelding@users.noreply.github.com> Date: Mon, 17 Feb 2025 18:13:35 +0100 Subject: [PATCH] skip push in pr --- update-check.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/update-check.py b/update-check.py index c5ddb9c..01ce65c 100644 --- a/update-check.py +++ b/update-check.py @@ -1,8 +1,9 @@ -import requests, os +import requests, os, sys def git(command): return os.system(f"git {command}") + release = requests.get("https://api.github.com/repos/protonmail/proton-bridge/releases/latest").json() version = release['tag_name'] deb = [asset for asset in release ['assets'] if asset['name'].endswith('.deb')][0]['browser_download_url'] @@ -26,6 +27,12 @@ if git("diff --cached --quiet") == 0: # Returns 0 if there are no changes git(f"commit -m 'Bump version to {version}'") +is_pull_request = sys.argv[1] == "true" + +if is_pull_request: + print("This is a pull request, skipping push step.") + exit(0) + if git("push") != 0: print("Git push failed!") exit(1)