From 23abae621f579014eb29d5c6621f031c8a1a4057 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 14 Mar 2022 15:28:57 +0200 Subject: [PATCH] CI: Fix patchcheck (GH-31708) --- .azure-pipelines/posix-steps.yml | 4 +++- Tools/scripts/patchcheck.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/posix-steps.yml b/.azure-pipelines/posix-steps.yml index 2a368089730..29b43e09344 100644 --- a/.azure-pipelines/posix-steps.yml +++ b/.azure-pipelines/posix-steps.yml @@ -66,7 +66,9 @@ steps: COMMAND: make - ${{ if eq(parameters.patchcheck, 'true') }}: - - script: ./python Tools/scripts/patchcheck.py --ci true + - script: | + git fetch origin + ./python Tools/scripts/patchcheck.py --ci true displayName: 'Run patchcheck.py' condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index 4cab66c8e97..a324eafc52b 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -130,6 +130,8 @@ def changed_files(base_branch=None): with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, cwd=SRCDIR) as st: + if st.wait() != 0: + sys.exit(f'error running {cmd}') for line in st.stdout: line = line.decode().rstrip() status_text, filename = line.split(maxsplit=1)