The open source coding agent.
TypeScript
ci: ignore
Aiden Clinee253398936fa
diff --git a/script/sync-zed.ts b/script/sync-zed.tsindex 7f194531309..29a1c030d42 100644--- a/script/sync-zed.ts+++ b/script/sync-zed.ts@@ -19,12 +19,10 @@ async function main() {const cleanVersion = version.replace(/^v/, "")console.log(`π¦ Syncing Zed extension for version ${cleanVersion}`)- // Get the commit SHA for this version tagconst commitSha = await $`git rev-parse ${version}`.text()const sha = commitSha.trim()console.log(`π Found commit SHA: ${sha}`)- // Read the extension.toml from this commit to verify versionconst extensionToml = await $`git show ${version}:packages/extensions/zed/extension.toml`.text()const parsed = Bun.TOML.parse(extensionToml) as { version: string }const extensionVersion = parsed.version@@ -55,7 +53,6 @@ async function main() {console.log(`πΏ Creating branch ${branchName}`)await $`git checkout -b ${branchName}`- // Update the submodule for opencode extensionconst submodulePath = `extensions/${EXTENSION_NAME}`console.log(`π Updating submodule to commit ${sha}`)await $`git submodule update --init ${submodulePath}`@@ -65,12 +62,10 @@ async function main() {process.chdir(workDir)await $`git add ${submodulePath}`- // Update extensions.tomlconsole.log(`π Updating extensions.toml`)const extensionsTomlPath = "extensions.toml"const extensionsToml = await Bun.file(extensionsTomlPath).text()- // Update version field for opencode extensionconst versionRegex = new RegExp(`(\\[${EXTENSION_NAME}\\]\\s+(?:.*\\s*)?)version = "[^"]+"`)const updatedToml = extensionsToml.replace(versionRegex, `$1version = "${cleanVersion}"`)@@ -81,7 +76,6 @@ async function main() {await Bun.write(extensionsTomlPath, updatedToml)await $`git add extensions.toml`- // Commit changesconst commitMessage = `Update ${EXTENSION_NAME} to v${cleanVersion}Release notes:@@ -91,11 +85,9 @@ https://github.com/${OPENCODE_REPO}/releases/tag/v${cleanVersion}`await $`git commit -m ${commitMessage}`console.log(`β Changes committed`)- // Push to forkconsole.log(`π Pushing to fork...`)await $`git push https://x-access-token:${token}@github.com/${FORK_REPO}.git ${branchName}`- // Create PR using gh CLIconsole.log(`π¬ Creating pull request...`)const prUrl =await $`gh pr create --repo ${UPSTREAM_REPO} --base main --head ${FORK_REPO.split("/")[0]}:${branchName} --title "Update ${EXTENSION_NAME} to v${cleanVersion}" --body "Release notes:\n\nhttps://github.com/${OPENCODE_REPO}/releases/tag/v${cleanVersion}"`.text()