Skip to content

Commit 27b166f

Browse files
committed
feat: Update open repository action to handle the new backends supported by mise (github, gitlab, http)
1 parent 3ad76c9 commit 27b166f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,7 @@ type MiseToolInfo = {
7171
tool_options: {
7272
os: string;
7373
install_env: Record<string, string>;
74+
api_url?: string;
75+
url?: string;
7476
};
7577
};

src/utils/miseUtilts.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,32 @@ export const getWebsiteForTool = async (toolInfo: MiseToolInfo) => {
161161
return `https://github.com/${repoName}`;
162162
}
163163

164+
if (backendName === "github") {
165+
if (toolInfo.tool_options.api_url) {
166+
const url = new URL(toolInfo.tool_options.api_url);
167+
return `${url.protocol}//${url.hostname}/${repo}`;
168+
}
169+
170+
return `https://github.com/${repo}`;
171+
}
172+
173+
if (backendName === "gitlab") {
174+
if (toolInfo.tool_options.api_url) {
175+
const url = new URL(toolInfo.tool_options.api_url);
176+
return `${url.protocol}//${url.hostname}/${repo}`;
177+
}
178+
179+
return `https://gitlab.com/${repo}`;
180+
}
181+
182+
if (backendName === "http") {
183+
if (toolInfo.tool_options.url) {
184+
return toolInfo.tool_options.url;
185+
}
186+
187+
return "https://mise.jdx.dev/dev-tools/backends/http.html";
188+
}
189+
164190
if (backendName === "core") {
165191
return `https://mise.jdx.dev/lang/${repo}`;
166192
}

0 commit comments

Comments
 (0)