GeezerVison is showing github.com — ci: improve err msg · land007/opencode@1da3550
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: script/sync-zed.ts +8-2Lines changed: 8 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -106,11 +106,17 @@ async function main() { |
106 | 106 | await $`git push https://x-access-token:${token}@github.com/${FORK_REPO}.git ${branchName}` |
107 | 107 |
|
108 | 108 | console.log(`📬 Creating pull request...`) |
109 | | - const prUrl = |
| 109 | + const prResult = |
110 | 110 | await $`gh pr create --repo ${UPSTREAM_REPO} --base main --head ${FORK_REPO.split("/")[0]}:${branchName} --title "Update ${EXTENSION_NAME} to v${cleanVersion}" --body "Updating OpenCode extension to v${cleanVersion}"` |
111 | 111 | .env({ GH_TOKEN: token }) |
112 | | - .text() |
| 112 | + .nothrow() |
113 | 113 |
|
| 114 | + if (prResult.exitCode !== 0) { |
| 115 | + console.error("stderr:", prResult.stderr.toString()) |
| 116 | + throw new Error(`Failed with exit code ${prResult.exitCode}`) |
| 117 | + } |
| 118 | + |
| 119 | + const prUrl = prResult.stdout.toString().trim() |
114 | 120 | console.log(`✅ Pull request created: ${prUrl}`) |
115 | 121 | console.log(`🎉 Done!`) |
116 | 122 | } |
|