From 8e71b459fd3fad86471dc0091637a6d951067ed7 Mon Sep 17 00:00:00 2001 From: Savio Dias Date: Fri, 27 Nov 2026 18:42:48 +0530 Subject: [PATCH] ci: wait for the publish run to be readable before watching it The run id returned by the dispatch can 404 for a moment, which failed the release before the publish finished. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/beta-release.yml | 4 ++++ .github/workflows/npm-publish.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 8149e7a3..26d0b1ae 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -73,6 +73,10 @@ jobs: --jq .workflow_run_id) PACKAGE="${{ steps.get_version.outputs.package }}@$VERSION" echo "Publishing $PACKAGE: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$RUN_ID" + for _ in $(seq 12); do + gh run view "$RUN_ID" --repo "$GITHUB_REPOSITORY" --json status > /dev/null 2>&1 && break + sleep 5 + done if ! gh run watch "$RUN_ID" --repo "$GITHUB_REPOSITORY" --exit-status --interval 30 > /dev/null; then gh run view "$RUN_ID" --repo "$GITHUB_REPOSITORY" --log-failed exit 1 diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index fba3f0d1..fd1f68e5 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -109,6 +109,10 @@ jobs: --jq .workflow_run_id) PACKAGE="$(node -p 'require("./package.json").name')@${VERSION#v}" echo "Publishing $PACKAGE: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$RUN_ID" + for _ in $(seq 12); do + gh run view "$RUN_ID" --repo "$GITHUB_REPOSITORY" --json status > /dev/null 2>&1 && break + sleep 5 + done if ! gh run watch "$RUN_ID" --repo "$GITHUB_REPOSITORY" --exit-status --interval 30 > /dev/null; then gh run view "$RUN_ID" --repo "$GITHUB_REPOSITORY" --log-failed exit 1