diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2019-09-14 13:43:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-14 13:43:29 -0700 |
| commit | 78318ae441b5a916f98f6188dd652c5ff0f9cd54 (patch) | |
| tree | 3eafefa73b5807d7346335015ac1509feafb569b /tools/upload_release_files.py | |
| parent | 157429f20de8ed6828941c98b9c90c4a1b587c76 (diff) | |
| parent | 54b03a7476ae8c000ff5fa8ede7ef38ad4ba0d7d (diff) | |
Merge pull request #2155 from tannewt/ignore_existing_files5.0.0-alpha.4
When uploading release assets, ignore those already uploaded.
Diffstat (limited to 'tools/upload_release_files.py')
| -rwxr-xr-x | tools/upload_release_files.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/upload_release_files.py b/tools/upload_release_files.py index 6c842dc68..4f193a8be 100755 --- a/tools/upload_release_files.py +++ b/tools/upload_release_files.py @@ -25,6 +25,9 @@ for dirpath, dirnames, filenames in os.walk("../bin"): 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) |
