diff options
| author | Aiden Cline <[email protected]> | 2025-11-09 13:54:14 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2025-11-09 13:54:14 -0600 |
| commit | 7be8e16c333891d48f80483d80c8a33ceb9f49a9 (patch) | |
| tree | b2e5cd9854fadee1ea0263c62476f5520f076655 /script/sync-zed.ts | |
| parent | d1588f93a10f62a4f733f6bd147245f508a47175 (diff) | |
| download | opencode-7be8e16c333891d48f80483d80c8a33ceb9f49a9.tar.gz opencode-7be8e16c333891d48f80483d80c8a33ceb9f49a9.zip | |
ci: sync zed
Diffstat (limited to 'script/sync-zed.ts')
| -rwxr-xr-x | script/sync-zed.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/script/sync-zed.ts b/script/sync-zed.ts index 7287280b2..6b4b4c7bb 100755 --- a/script/sync-zed.ts +++ b/script/sync-zed.ts @@ -85,6 +85,24 @@ async function main() { await $`git commit -m ${commitMessage}` console.log(`✅ Changes committed`) + // Delete any existing branches for opencode updates + console.log(`🔍 Checking for existing branches...`) + const branches = await $`git ls-remote --heads https://x-access-token:${token}@github.com/${FORK_REPO}.git`.text() + const branchPattern = `refs/heads/update-${EXTENSION_NAME}-` + const oldBranches = branches + .split("\n") + .filter((line) => line.includes(branchPattern)) + .map((line) => line.split("refs/heads/")[1]) + .filter(Boolean) + + if (oldBranches.length > 0) { + console.log(`🗑️ Found ${oldBranches.length} old branch(es), deleting...`) + for (const branch of oldBranches) { + await $`git push https://x-access-token:${token}@github.com/${FORK_REPO}.git --delete ${branch}` + console.log(`✅ Deleted branch ${branch}`) + } + } + console.log(`🚀 Pushing to fork...`) await $`git push https://x-access-token:${token}@github.com/${FORK_REPO}.git ${branchName}` |
