feat(sync): add resolveBranchHead to fetch branch tip SHA
This commit is contained in:
@@ -88,6 +88,16 @@ export const getRepository = async (
|
||||
return result.data;
|
||||
};
|
||||
|
||||
export const resolveBranchHead = async (
|
||||
octokit: Octokit,
|
||||
owner: string,
|
||||
repo: string,
|
||||
branch: string,
|
||||
): Promise<{ sha: string }> => {
|
||||
const result = await octokit.rest.repos.getBranch({ owner, repo, branch });
|
||||
return { sha: result.data.commit.sha };
|
||||
};
|
||||
|
||||
const toMillis = (value?: string | null) =>
|
||||
value ? new Date(value).getTime() : undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user