Browse Source

ci: update zed sync script

Aiden Cline 3 months ago
parent
commit
1995be3599
1 changed files with 9 additions and 9 deletions
  1. 9 9
      script/sync-zed.ts

+ 9 - 9
script/sync-zed.ts

@@ -10,10 +10,10 @@ const EXTENSION_NAME = "opencode"
 
 async function main() {
   const version = process.argv[2]
-  if (!version) throw new Error("Version argument required: bun script/sync-zed.ts v1.0.52")
+  if (!version) throw new Error("Version argument required, ex: bun script/sync-zed.ts v1.0.52")
 
-  const token = process.env.GITHUB_TOKEN
-  if (!token) throw new Error("GITHUB_TOKEN environment variable required")
+  const token = process.env.ZED_EXTENSIONS_PAT
+  if (!token) throw new Error("ZED_EXTENSIONS_PAT environment variable required")
 
   const cleanVersion = version.replace(/^v/, "")
   console.log(`📦 Syncing Zed extension for version ${cleanVersion}`)
@@ -39,17 +39,17 @@ async function main() {
   process.chdir(workDir)
 
   // Configure git identity
-  await $`git config user.name "Dax Raad"`
-  await $`git config user.email "[email protected]"`
+  await $`git config user.name "Aiden Cline"`
+  await $`git config user.email "[email protected] "`
 
-  // Sync fork with upstream
+  // Sync fork with upstream (force reset to match exactly)
   console.log(`🔄 Syncing fork with upstream...`)
   await $`git remote add upstream https://github.com/${UPSTREAM_REPO}.git`
   await $`git fetch upstream`
   await $`git checkout main`
-  await $`git merge upstream/main --ff-only`
-  await $`git push origin main`
-  console.log(`✅ Fork synced`)
+  await $`git reset --hard upstream/main`
+  await $`git push origin main --force`
+  console.log(`✅ Fork synced (force reset to upstream)`)
 
   // Create a new branch
   const branchName = `update-${EXTENSION_NAME}-${cleanVersion}`