Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/scripts/ensure-release-candidate-branches.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
resolveReleaseTagForTrack,
sh,
tagVersionInfoToReleaseCandidateBranchName,
trySh,
writeGithubOutput,
} from './github-helpers.mjs';

Expand Down Expand Up @@ -88,12 +89,12 @@ function removeBranch(branch) {

console.log(`Removing remote branch ${branch} from origin...`);
// Delete remote branch
sh('git', ['push', 'origin', '--delete', branch]);
trySh('git', ['push', 'origin', '--delete', branch]);

// Optional local cleanup (keeps reruns tidy)
if (localRefExists(`refs/heads/${branch}`)) {
console.log(`Removing local branch ${branch}...`);
sh('git', ['branch', '-D', branch]);
trySh('git', ['branch', '-D', branch]);
}

return branch;
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/ensure-release-candidate-branches.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mock.module('./github-helpers.mjs', {
},
writeGithubOutput: () => {}, // no-op in tests
sh: () => {}, // no-op in tests
trySh: () => {}, // no-op in tests
getCommitForRef: () => {}, // no-op in tests
remoteBranchExists: () => {}, // no-op in tests
localRefExists: () => {}, // no-op in tests
Expand Down
Loading