mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-17 23:53:24 +02:00
26 lines
582 B
TypeScript
26 lines
582 B
TypeScript
import { z } from "zod";
|
|
import { githubRequest, buildUrl } from "../common/utils.js";
|
|
|
|
export const ListCommitsSchema = z.object({
|
|
owner: z.string(),
|
|
repo: z.string(),
|
|
sha: z.string().optional(),
|
|
page: z.number().optional(),
|
|
perPage: z.number().optional()
|
|
});
|
|
|
|
export async function listCommits(
|
|
owner: string,
|
|
repo: string,
|
|
page?: number,
|
|
perPage?: number,
|
|
sha?: string
|
|
) {
|
|
return githubRequest(
|
|
buildUrl(`https://api.github.com/repos/${owner}/${repo}/commits`, {
|
|
page: page?.toString(),
|
|
per_page: perPage?.toString(),
|
|
sha
|
|
})
|
|
);
|
|
} |