CI: Fix patchcheck (GH-31708)

This commit is contained in:
Hugo van Kemenade 2022-03-14 15:28:57 +02:00 committed by GitHub
parent bb1c543f4a
commit 23abae621f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -66,7 +66,9 @@ steps:
COMMAND: make COMMAND: make
- ${{ if eq(parameters.patchcheck, 'true') }}: - ${{ 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' displayName: 'Run patchcheck.py'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

View File

@ -130,6 +130,8 @@ def changed_files(base_branch=None):
with subprocess.Popen(cmd.split(), with subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
cwd=SRCDIR) as st: cwd=SRCDIR) as st:
if st.wait() != 0:
sys.exit(f'error running {cmd}')
for line in st.stdout: for line in st.stdout:
line = line.decode().rstrip() line = line.decode().rstrip()
status_text, filename = line.split(maxsplit=1) status_text, filename = line.split(maxsplit=1)