mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-17 18:16:08 +00:00
fix(ci): publish dev-latest edit-first instead of probing for existence
The dev-latest publish step probed for the release with gh release view before choosing edit or create. During the api.github.com 503 storm the probe itself failed, mis-routing an existing release into the create path, which then died on a permanent 422 already-exists error that no amount of retrying can fix. The release exists on every run but the very first, so edit first and fall back to create only when the edit fails. The retry log line now names the gh subcommand instead of just the binary.
This commit is contained in:
@@ -372,7 +372,7 @@ jobs:
|
||||
retry() {
|
||||
for i in 1 2 3 4 5; do
|
||||
"$@" && return 0
|
||||
echo "attempt $i failed: $1" >&2
|
||||
echo "attempt $i failed: ${*:1:3}" >&2
|
||||
sleep $((i * 5))
|
||||
done
|
||||
return 1
|
||||
@@ -389,10 +389,10 @@ jobs:
|
||||
git tag -f dev-latest "${COMMIT}"
|
||||
retry git push -f origin refs/tags/dev-latest
|
||||
|
||||
if gh release view dev-latest >/dev/null 2>&1; then
|
||||
retry gh release edit dev-latest --prerelease --latest=false \
|
||||
--title "Dev build ${short}" --notes "${notes}"
|
||||
else
|
||||
# The release exists on every run but the first; edit-first avoids an
|
||||
# existence probe that can 503 and mis-route into create (422).
|
||||
if ! retry gh release edit dev-latest --prerelease --latest=false \
|
||||
--title "Dev build ${short}" --notes "${notes}"; then
|
||||
retry gh release create dev-latest --prerelease --latest=false \
|
||||
--target "${COMMIT}" --title "Dev build ${short}" --notes "${notes}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user