From 57eb29925981a482a065cf2f1ba787b8dd53dc76 Mon Sep 17 00:00:00 2001 From: Aseem Shrey Date: Sun, 15 Feb 2026 19:01:06 -0500 Subject: [PATCH 1/2] fix(release): make workflow idempotent and resilient - Replace softprops/action-gh-release with gh CLI to handle existing releases (update instead of fail on re-runs) - Add continue-on-error to version bump step so Docker image pushes aren't marked as failed when the PR step has issues Signed-off-by: Aseem Shrey --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 529a5d4c..646fb61c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -200,16 +200,32 @@ jobs: cat CHANGELOG.md >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - name: Create GitHub Release - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ steps.version.outputs.version }} - name: Release ${{ steps.version.outputs.version }} - body_path: CHANGELOG.md - draft: false - prerelease: ${{ contains(steps.version.outputs.version, '-') }} + - name: Create or update GitHub Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION="${{ steps.version.outputs.version }}" + IS_PRERELEASE="${{ contains(steps.version.outputs.version, '-') }}" + PRERELEASE_FLAG="" + if [ "$IS_PRERELEASE" = "true" ]; then + PRERELEASE_FLAG="--prerelease" + fi + + # Check if release already exists + if gh release view "$VERSION" --repo "${{ github.repository }}" > /dev/null 2>&1; then + echo "Release $VERSION already exists, updating..." + gh release edit "$VERSION" \ + --repo "${{ github.repository }}" \ + --notes-file CHANGELOG.md \ + $PRERELEASE_FLAG + else + echo "Creating new release $VERSION..." + gh release create "$VERSION" \ + --repo "${{ github.repository }}" \ + --title "Release $VERSION" \ + --notes-file CHANGELOG.md \ + $PRERELEASE_FLAG + fi - name: Update version check service env: @@ -264,6 +280,7 @@ jobs: - name: Bump package.json version via PR if: steps.is_latest.outputs.is_latest == 'true' + continue-on-error: true env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From 8327ddc3e4883cb58d9051f862f1a52fa57cb119 Mon Sep 17 00:00:00 2001 From: Aseem Shrey Date: Sun, 15 Feb 2026 19:13:31 -0500 Subject: [PATCH 2/2] fix(release): use unique branch names for version bump PRs Append workflow run ID to the bump branch name so re-running the release for the same version doesn't fail due to branch conflicts. Also cleans up any stale bump branches from previous runs. Signed-off-by: Aseem Shrey --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 646fb61c..8c9de3ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -285,13 +285,18 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | VERSION_CLEAN="${{ steps.version.outputs.version_clean }}" - BRANCH="chore/bump-version-${VERSION_CLEAN}" + RUN_ID="${{ github.run_id }}" + BRANCH="chore/bump-version-${VERSION_CLEAN}-${RUN_ID}" echo "Bumping root package.json version to ${VERSION_CLEAN}..." git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git fetch origin main + + # Clean up any existing bump branch for this version + git push origin --delete "chore/bump-version-${VERSION_CLEAN}" 2>/dev/null || true + git checkout -b "$BRANCH" origin/main # Update the root package.json version