From 2f156c8eb04cd2ebbb0a0b9e74d6f2f83fe08eee Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 17 Jul 2026 01:34:47 +0200 Subject: [PATCH] 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. --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfd9d1747..604697eb5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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