1
2
3
4
5
6
7
8
9
10
11
12
13
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export let initialCommit = async (org, repo) => {
const repoData = await fetchJSON(
`https://api.github.com/repos/${org}/${repo}`
);
const { created_at } = repoData;
const until = new Date(Date.parse(created_at) + 600).toISOString();
const json = await fetchJSON(
`https://api.github.com/repos/${org}/${repo}/commits?until=${until}`
);
return json;
};