Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 7be8e16

Browse files
committed
ci: sync zed
1 parent d1588f9 commit 7be8e16

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

script/sync-zed.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,24 @@ async function main() {
8585
await $`git commit -m ${commitMessage}`
8686
console.log(`✅ Changes committed`)
8787

88+
// Delete any existing branches for opencode updates
89+
console.log(`🔍 Checking for existing branches...`)
90+
const branches = await $`git ls-remote --heads https://x-access-token:${token}@github.com/${FORK_REPO}.git`.text()
91+
const branchPattern = `refs/heads/update-${EXTENSION_NAME}-`
92+
const oldBranches = branches
93+
.split("\n")
94+
.filter((line) => line.includes(branchPattern))
95+
.map((line) => line.split("refs/heads/")[1])
96+
.filter(Boolean)
97+
98+
if (oldBranches.length > 0) {
99+
console.log(`🗑️ Found ${oldBranches.length} old branch(es), deleting...`)
100+
for (const branch of oldBranches) {
101+
await $`git push https://x-access-token:${token}@github.com/${FORK_REPO}.git --delete ${branch}`
102+
console.log(`✅ Deleted branch ${branch}`)
103+
}
104+
}
105+
88106
console.log(`🚀 Pushing to fork...`)
89107
await $`git push https://x-access-token:${token}@github.com/${FORK_REPO}.git ${branchName}`
90108

0 commit comments

Comments
 (0)