mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Merge PR #5015: CI: Fix PR checks for backports
This commit is contained in:
commit
6bc53050ec
10
.github/workflows/check_commit_style.py
vendored
10
.github/workflows/check_commit_style.py
vendored
@ -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()
|
||||
|
||||
|
||||
2
.github/workflows/pr-checks.yml
vendored
2
.github/workflows/pr-checks.yml
vendored
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user