From 9b9c44b5653811eda449051fb6455566ce9da99f Mon Sep 17 00:00:00 2001 From: Bartosz Cichocki Date: Tue, 23 Nov 2021 15:09:26 +0100 Subject: [PATCH] [EGD-8000] Fix commit name check for community builds Community commits were incorectly verified during checks on CI. In details - commit list to check was incorrectly created thus covered much more commits than it had to --- tools/check_commit_messages.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/check_commit_messages.py b/tools/check_commit_messages.py index 72c409e6afb8ab9d499b1a0cc31fd5c1746db4b2..7c9330d9e45640c938aa87df365fa8023c9daaff 100755 --- a/tools/check_commit_messages.py +++ b/tools/check_commit_messages.py @@ -12,6 +12,16 @@ import re def get_pull_request_commits(): github_base_ref = os.environ['GITHUB_BASE_REF'] github_head_ref = os.environ['GITHUB_HEAD_REF'] + try: + is_fork = ("true" in os.environ['fork']) + except: + is_fork = False + + if is_fork: + print("Checking fork against original repo!") + pr_from_sha = os.environ['pr_from_sha'] + pr_to_sha = os.environ['pr_to_sha'] + return Repo('.').iter_commits(rev=f'{pr_to_sha}..{pr_from_sha}') return Repo('.').iter_commits(rev=f'origin/{github_base_ref}..origin/{github_head_ref}')