MCPcopy
hub / github.com/refined-github/refined-github / addCiStatus

Function addCiStatus

source/features/repo-header-info.tsx:112–138  ·  view source on GitHub ↗
(anchor: HTMLElement, ciCommit: string | undefined)

Source from the content-addressed store, hash-verified

110}
111
112function addCiStatus(anchor: HTMLElement, ciCommit: string | undefined): void {
113 if (!ciCommit) {
114 return;
115 }
116
117 prepareForAddition(anchor);
118
119 const endpoint = buildRepoUrl('commits/checks-statuses-rollups');
120 anchor.parentElement!.append(
121 // Hide in small viewports
122 <span
123 className="rgh-ci-link d-none d-sm-flex flex-items-center flex-justify-center p-1 tmp-p-1 Button Button--invisible"
124 title="CI status of latest commit"
125 >
126 <batch-deferred-content hidden data-url={endpoint}>
127 <input
128 name="oid"
129 value={ciCommit}
130 data-targets="batch-deferred-content.inputs"
131 />
132 </batch-deferred-content>
133 </span>,
134 );
135
136 // A parent is clipping the popup
137 closestElementOptional('.AppHeader-context-full', anchor)?.style.setProperty('overflow', 'visible');
138}
139
140async function add(repoLink: HTMLElement): Promise<void> {
141 const info = await getRepositoryInfo();

Callers 1

addFunction · 0.85

Calls 3

prepareForAdditionFunction · 0.85
buildRepoUrlFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected