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

Function addToNewRelease

source/features/unreleased-commits.tsx:168–188  ·  view source on GitHub ↗
(header: HTMLElement)

Source from the content-addressed store, hash-verified

166}
167
168async function addToNewRelease(header: HTMLElement): Promise<void> {
169 const {latestTag, aheadBy} = await repoPublishState.get();
170 const isAhead = aheadBy > 0;
171
172 if (!latestTag || !isAhead) {
173 return;
174 }
175
176 const defaultBranch = await getDefaultBranch();
177
178 header.append(
179 ' ',
180 <a target="_blank" href={buildRepoUrl('compare', `${latestTag}...${defaultBranch}`)}>
181 {pluralize(aheadBy, '$$ unreleased commit')}
182 </a>,
183 ` on ${defaultBranch} since `,
184 <a target="_blank" href={buildRepoUrl('releases', latestTag)}>
185 {abbreviateString(latestTag, 30)}
186 </a>,
187 );
188}
189
190function initHome(signal: AbortSignal): void {
191 observe(branchSelector, addToHome, {signal});

Callers

nothing calls this directly

Calls 6

getDefaultBranchFunction · 0.85
buildRepoUrlFunction · 0.85
pluralizeFunction · 0.85
abbreviateStringFunction · 0.85
getMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected