8000 Merge pull request #2155 from tannewt/ignore_existing_files · sarfata/circuitpython@78318ae · GitHub
[go: up one dir, main page]

Skip to content

Commit 78318ae

Browse files
authored
Merge pull request adafruit#2155 from tannewt/ignore_existing_files
When uploading release assets, ignore those already uploaded.
2 parents 157429f + 54b03a7 commit 78318ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/upload_release_files.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
with open(full_filename, "rb") as f:
2626
response = github.post(url, data=f, headers=headers)
2727
if not response.ok:
28+
if response.status_code == 422 and response.json().get("errors", [{"code":""}])[0]["code"] == "already_exists":
29+
print("File already uploaded. Skipping.")
30+
continue
2831
print("Upload of {} failed with {}.".format(filename, response.status_code))
2932
print(response.text)
3033
sys.exit(response.status_code)

0 commit comments

Comments
 (0)
0