Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use github API for downloading the diff #278

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading