Skip to content

Commit

Permalink
Merge pull request #278 from smoors/curl_api
Browse files Browse the repository at this point in the history
use github API for downloading the diff
  • Loading branch information
trz42 authored Sep 9, 2024
2 parents d17c46a + b8c3d48 commit 6f4eb2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tasks/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ def download_pr(repo_name, branch_name, pr, arch_job_dir):
error_stage = _ERROR_GIT_CHECKOUT
return checkout_output, checkout_err, checkout_exit_code, error_stage

curl_cmd = f'curl -L https://github.com/{repo_name}/pull/{pr.number}.diff > {pr.number}.diff'
curl_cmd = ' '.join([
'curl -L',
'-H "Accept: application/vnd.github.diff"',
'-H "X-GitHub-Api-Version: 2022-11-28"',
f'https://api.github.com/repos/{repo_name}/pulls/{pr.number} > {pr.number}.diff',
])
log(f'curl with command {curl_cmd}')
curl_output, curl_error, curl_exit_code = run_cmd(
curl_cmd, "Obtain patch", arch_job_dir, raise_on_error=False
Expand Down

0 comments on commit 6f4eb2b

Please sign in to comment.