opencode-studio-server 1.22.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1104,7 +1104,11 @@ async function ensureGitHubRepo(token, repoName) {
|
|
|
1104
1104
|
|
|
1105
1105
|
if (response.ok) {
|
|
1106
1106
|
const data = await response.json();
|
|
1107
|
-
|
|
1107
|
+
const branch = data.default_branch || 'main';
|
|
1108
|
+
const refRes = await fetch(`https://api.github.com/repos/${owner}/${repo}/git/refs/heads/${branch}`, {
|
|
1109
|
+
headers: { 'Authorization': `Bearer ${token}` }
|
|
1110
|
+
});
|
|
1111
|
+
if (refRes.status === 404 || refRes.status === 409) {
|
|
1108
1112
|
await bootstrapEmptyRepo(token, owner, repo);
|
|
1109
1113
|
}
|
|
1110
1114
|
return data;
|