Skip to content

Commit

Permalink
Merge pull request #2155 from tannewt/ignore_existing_files
Browse files Browse the repository at this point in the history
When uploading release assets, ignore those already uploaded.
  • Loading branch information
tannewt committed Sep 14, 2019
2 parents 157429f + 54b03a7 commit 78318ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/upload_release_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
with open(full_filename, "rb") as f:
response = github.post(url, data=f, headers=headers)
if not response.ok:
if response.status_code == 422 and response.json().get("errors", [{"code":""}])[0]["code"] == "already_exists":
print("File already uploaded. Skipping.")
continue
print("Upload of {} failed with {}.".format(filename, response.status_code))
print(response.text)
sys.exit(response.status_code)
Expand Down

0 comments on commit 78318ae

Please sign in to comment.