(header: HTMLElement)
| 166 | } |
| 167 | |
| 168 | async 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 | |
| 190 | function initHome(signal: AbortSignal): void { |
| 191 | observe(branchSelector, addToHome, {signal}); |
nothing calls this directly
no test coverage detected