From 50d79d48b4e3bba8c68b5d90ac468e0c302ae41c Mon Sep 17 00:00:00 2001 From: Tupui <23188539+tupui@users.noreply.github.com> Date: Tue, 10 Sep 2024 02:19:57 +0200 Subject: [PATCH] Fix pre-commit not main check --- pre-commit/soroban_versioning_pre_push.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pre-commit/soroban_versioning_pre_push.py b/pre-commit/soroban_versioning_pre_push.py index 7961033..bacf99d 100644 --- a/pre-commit/soroban_versioning_pre_push.py +++ b/pre-commit/soroban_versioning_pre_push.py @@ -19,9 +19,6 @@ "TANSU_CONTRACT_ID", "CAP52ERGUZ65UNPHP36CQBHYUPEUG2TT4NPVEV7CREWRT7UCPD7PRWEE" ) PROJECT_KEY = os.getenv("TANSU_PROJECT_KEY") -if PROJECT_KEY is None: - raise ValueError("'TANSU_PROJECT_KEY' is missing from the environment") - BRANCH = os.getenv("TANSU_BRANCH", "main") @@ -36,6 +33,9 @@ def main(): if branch != BRANCH: exit(0) + if PROJECT_KEY is None: + raise ValueError("'TANSU_PROJECT_KEY' is missing from the environment") + commit_hash = ( subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True) .stdout.decode()