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 intoMar 26, 2026
Conversation
Contributor
There was a problem hiding this comment.
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)
Matsuuu
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #27602 to
release-candidate/2.14.x.Checklist for the author (@Matsuuu) to go through.
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
shtotryShto 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
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)