Skip to content

Commit

Permalink
Improve robustness of asset upload during release creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored and jcfr committed Aug 26, 2022
1 parent c30e1c1 commit 580ece6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions github_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,18 @@ def get_releases(repo_name, verbose=False):
return releases


@backoff.on_predicate(backoff.expo, lambda x: x is None, max_time=5)
def get_release(repo_name, tag_name):
"""Return release
.. note::
If the release is not found (e.g the release was just created and
the GitHub response is not yet updated), this function is called again by
leveraging the `backoff` decorator.
See https://github.com/j0057/github-release/issues/67
"""
releases = get_releases(repo_name)
try:
release = next(r for r in releases if r['tag_name'] == tag_name)
Expand Down

0 comments on commit 580ece6

Please sign in to comment.