(signal: AbortSignal)
| 109 | } |
| 110 | |
| 111 | async function init(signal: AbortSignal): Promise<void> { |
| 112 | const mergeCommit = $(`.TimelineItem.js-details-container.Details a[href^="/${getRepo()!.nameWithOwner}/commit/" i]`); |
| 113 | const {hash} = /commit\/(?<hash>[0-9a-f]{40})/.exec(mergeCommit.pathname)!.groups!; |
| 114 | const tagName = await firstTag.get(hash); |
| 115 | |
| 116 | if (tagName) { |
| 117 | const tagUrl = buildRepoUrl('releases/tag', tagName); |
| 118 | |
| 119 | // Add static box at the bottom |
| 120 | addTagToFooter(tagName, tagUrl, signal); |
| 121 | |
| 122 | // PRs have a regular and a sticky header |
| 123 | observe('[class*="PullRequestHeaderSummary"] relative-time', addTagToHeader.bind(undefined, tagName, tagUrl), { |
| 124 | signal, |
| 125 | }); |
| 126 | return; |
| 127 | } |
| 128 | |
| 129 | void addReleaseBanner( |
| 130 | <> |
| 131 | No <ExplanationLink>stable version tags</ExplanationLink> for this PR. |
| 132 | </>, |
| 133 | signal, |
| 134 | ); |
| 135 | } |
| 136 | |
| 137 | void features.add(import.meta.url, { |
| 138 | // When arriving on an already-merged PR |
nothing calls this directly
no test coverage detected