MCPcopy Index your code
hub / github.com/refined-github/refined-github / getRepositoryInfo

Function getRepositoryInfo

source/features/repo-header-info.tsx:27–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25};
26
27async function getRepositoryInfo(): Promise<RepositoryInfo> {
28 const {repository} = await api.v4(GetRepoInfo);
29
30 let ciCommit: string | undefined;
31 if (!repository.isEmpty && repository.defaultBranchRef) {
32 // Check earlier commits just in case the last one is CI-generated and doesn't have checks
33 for (const commit of repository.defaultBranchRef.target.history.nodes) {
34 if (!commit.statusCheckRollup) {
35 continue;
36 }
37
38 ciCommit = commit.oid;
39 break;
40 }
41 }
42
43 return {
44 ...repository,
45 ciCommit,
46 };
47}
48
49function prepareForAddition(element: HTMLElement): void {
50 if (!element.classList.contains('AppHeader-context-item')) {

Callers 1

addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected