trivial: set the reference commit to run style check against on CI

This commit is contained in:
Mario Limonciello 2021-07-24 14:20:46 -05:00
parent 987e7d2929
commit 01f79c0339
2 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Refresh dependencies
run: sudo apt update
- name: Install dependencies

View File

@ -32,9 +32,14 @@ def select_clang_version(formatters):
## Entry Point ##
if __name__ == "__main__":
base = os.getenv("GITHUB_BASE_REF")
if base:
base = "origin/%s" % base
else:
base = "HEAD"
formatter = select_clang_version(CLANG_DIFF_FORMATTERS)
ret = subprocess.run(
["git", "diff", "-U0", "HEAD"], capture_output=True, check=True, text=True
["git", "diff", "-U0", base], capture_output=True, check=True, text=True
)
if ret.returncode:
print("Failed to run git diff: %s" % ret.stderr)