Skip to content

Commit

Permalink
Retry on gh command failure
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Sep 9, 2023
1 parent 449e4f3 commit 64b7a65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com

## [Unreleased]

- Improve robustness for temporary network failures.

## [1.7.1] - 2023-08-06

- Update `parse-changelog` to 0.6.2.
Expand Down
6 changes: 3 additions & 3 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ if [[ -n "${changelog}" ]]; then
fi

# https://cli.github.com/manual/gh_release_view
if GITHUB_TOKEN="${token}" gh release view "${tag}" &>/dev/null; then
if GITHUB_TOKEN="${token}" retry gh release view "${tag}" &>/dev/null; then
# https://cli.github.com/manual/gh_release_delete
GITHUB_TOKEN="${token}" gh release delete "${tag}" -y
GITHUB_TOKEN="${token}" retry gh release delete "${tag}" -y
fi

# https://cli.github.com/manual/gh_release_create
GITHUB_TOKEN="${token}" gh release create "${release_options[@]}" --title "${title}" --notes "${notes:-}"
GITHUB_TOKEN="${token}" retry gh release create "${release_options[@]}" --title "${title}" --notes "${notes:-}"

# Set (computed) prefix and version outputs for future step use.
computed_prefix=${tag%"${version}"}
Expand Down

0 comments on commit 64b7a65

Please sign in to comment.