~aleteoryx/muditaos

9b9c44b5653811eda449051fb6455566ce9da99f — Bartosz Cichocki 4 years ago d731a85
[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
1 files changed, 10 insertions(+), 0 deletions(-)

M tools/check_commit_messages.py
M tools/check_commit_messages.py => tools/check_commit_messages.py +10 -0
@@ 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}')