Merge PR #5015: CI: Fix PR checks for backports

This commit is contained in:
Robert Adam 2021-05-20 09:00:20 +02:00 committed by GitHub
commit 6bc53050ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -19,6 +19,14 @@ def cmd(args):
def main():
targetBranch = ""
if len(sys.argv) > 1:
targetBranch = sys.argv[1]
else:
raise RuntimeError("Target branch not specified!")
print("Checking commit styles - target branch: \"{}\"".format(targetBranch))
try:
# Set up remote
remoteName = "mumble-upstream"
@ -28,7 +36,7 @@ def main():
cmd(["git", "fetch", "--no-recurse-submodules", remoteName])
# get new commits
commitHashes = [x for x in cmd(["git", "rev-list", "{}/master..HEAD".format(remoteName)]).split("\n") if x]
commitHashes = [x for x in cmd(["git", "rev-list", "{}/{}..HEAD".format(remoteName, targetBranch)]).split("\n") if x]
# Reverse the order of the commits so that oldest comes first
commitHashes.reverse()

View File

@ -21,7 +21,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check commit style
run: $GITHUB_WORKSPACE/.github/workflows/check_commit_style.py
run: $GITHUB_WORKSPACE/.github/workflows/check_commit_style.py ${{ github.base_ref }}
shell: bash
- name: Check line endings