fix typecheck error

This commit is contained in:
yiqingxiong 2026-02-06 17:13:26 +08:00
parent 86e25ab0cd
commit f6d7bbc902
5 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,4 @@
import type { Octokits } from "../api/client";
import { GITHUB_SERVER_URL, USE_GITEA_API } from "../api/config";
import { createBranchUrl } from "./comments/common";
import { $ } from "bun";

View File

@ -305,5 +305,6 @@ export async function setupBranch(
} catch (error) {
console.error("Error in branch setup:", error);
process.exit(1);
throw error;
}
}

View File

@ -1,4 +1,4 @@
import { GITHUB_SERVER_URL, USE_GITEA_API } from "../api/config";
import { USE_GITEA_API } from "../api/config";
import { createBranchUrl } from "./comments/common";
export type ExecutionDetails = {
@ -162,7 +162,7 @@ export function updateCommentBody(input: CommentUpdateInput): string {
const repoMatch = USE_GITEA_API
? jobUrl.match(/\/([^\/]+)\/([^\/]+)\/(?:actions|tree|src)/)
: jobUrl.match(/github\.com\/([^\/]+)\/([^\/]+)\//);
if (repoMatch) {
if (repoMatch && repoMatch[1] && repoMatch[2]) {
branchUrl = createBranchUrl(
repoMatch[1],
repoMatch[2],

View File

@ -151,5 +151,6 @@ export async function setupGitHubToken(): Promise<string> {
`Failed to setup GitHub token: ${error}\n\nIf you instead wish to use this action with a custom GitHub token or custom GitHub app, provide a \`github_token\` in the \`uses\` section of the app in your workflow yml file.`,
);
process.exit(1);
throw error;
}
}

View File

@ -224,5 +224,6 @@ export async function prepareMcpConfig(
} catch (error) {
core.setFailed(`Install MCP server failed with error: ${error}`);
process.exit(1);
throw error;
}
}