eine / tip

GitHub Action to keep a 'tip' pre-release always up-to-date
20 stars 7 forks source link

Fails on empty files #159

Closed lazka closed 4 years ago

lazka commented 4 years ago

If there are empty files to be uploaded I get:

2020-07-29T20:55:10.6028756Z · Get GitHub API handler (authenticate)
2020-07-29T20:55:10.6029018Z · Get Repository handler
2020-07-29T20:55:10.6029268Z · Get Release handler
2020-07-29T20:55:10.6029492Z · Upload artifacts
2020-07-29T20:55:10.6379916Z  > artifact/failed/mingw-w64-i686-bison-3.0.4-2.failed
2020-07-29T20:55:10.6380250Z    - uploading...
2020-07-29T20:55:10.6384266Z Traceback (most recent call last):
2020-07-29T20:55:10.6387648Z   File "/tip.py", line 130, in <module>
2020-07-29T20:55:10.6387774Z     gh_release.upload_asset(artifact)
2020-07-29T20:55:10.6388280Z   File "/usr/local/lib/python3.8/site-packages/github/GitRelease.py", line 256, in upload_asset
2020-07-29T20:55:10.6388437Z     resp_headers, data = self._requester.requestBlobAndCheck(
2020-07-29T20:55:10.6389094Z   File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 333, in requestBlobAndCheck
2020-07-29T20:55:10.6389221Z     return self.__check(
2020-07-29T20:55:10.6389513Z   File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 342, in __check
2020-07-29T20:55:10.6389632Z     raise self.__createException(status, responseHeaders, output)
2020-07-29T20:55:10.6389999Z github.GithubException.GithubException: 400 {"message": "Bad Content-Length: ", "request_id": "0442:0DFD:62693:78B10:5F21E22E"}

I'd guess this is really rare, so not sure if that needs to be handled..

BobAnkh commented 4 years ago

I think this is not too much work to handle. Just to check if it is empty. I think this needs to be handled for not preventing other files to be uploaded.

eine commented 4 years ago

Now empty files are skipped. See, for instance, https://github.com/eine/tip/runs/1235879535?check_suite_focus=true#step:11:31.