Skip to content

ci: Don't error on release candidate cleanup when branch is missing (backport to release-candidate/2.14.x) - #27612

Merged
Matsuuu merged 1 commit into
release-candidate/2.14.xfrom
backport-27602-to-release-candidate/2.14.x
Mar 26, 2026
Merged

Matsuuu merged 1 commit into
release-candidate/2.14.xfrom
backport-27602-to-release-candidate/2.14.x

Conversation

@n8n-assistant

@n8n-assistant n8n-assistant Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Description

Backport of #27602 to release-candidate/2.14.x.

Checklist for the author (@Matsuuu) to go through.

  • Review the backport changes
  • Fix possible conflicts
  • Merge to target branch

After this PR has been merged, it will be picked up in the next patch release for release track.

Original description

Summary

Sometimes release-candidate branch cleanup can use stale refs and errors out when trying to delete already removed branch. Change sh to trySh to prevent erroring out on missing refs.

Related Linear tickets, Github issues, and Community forum posts

https://github.com/n8n-io/n8n/actions/runs/23585227865/job/68680205979

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Architecture diagram
sequenceDiagram
    participant Runner as GitHub Actions Runner
    participant Script as ensure-release-candidate-branches.mjs
    participant Git as Git CLI
    participant Origin as Remote (Origin)

    Note over Runner, Origin: Release Candidate Cleanup Flow

    Runner->>Script: run script
    Script->>Script: Identify stale branches to remove

    loop For each stale branch
        Script->>Git: CHANGED: trySh('git push origin --delete branch')
        Git->>Origin: Request branch deletion
        
        alt Branch exists on remote
            Origin-->>Git: Success
            Git-->>Script: Exit Code 0
        else Branch already deleted (Stale Ref)
            Origin-->>Git: Error: remote ref does not exist
            Git-->>Script: CHANGED: Non-zero exit (Ignored by trySh)
        end

        opt Local ref exists
            Script->>Git: CHANGED: trySh('git branch -D branch')
            alt Branch exists locally
                Git-->>Script: Branch deleted
            else Branch missing/error
                Git-->>Script: CHANGED: Error (Ignored by trySh)
            end
        end
    end

    Script-->>Runner: Script completes (Success)
Loading

@Matsuuu
Matsuuu merged commit cad90b0 into release-candidate/2.14.x Mar 26, 2026
18 checks passed
@Matsuuu
Matsuuu deleted the backport-27602-to-release-candidate/2.14.x branch March 26, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant