| 170 | } |
| 171 | |
| 172 | async function published(to: string) { |
| 173 | if (to === "HEAD") return |
| 174 | const body = await $`gh release view ${ref(to)} --repo ${repo} --json body --jq .body`.text().catch(() => "") |
| 175 | if (!body) return |
| 176 | |
| 177 | const lines = body.split(/\r?\n/) |
| 178 | const start = lines.findIndex((line) => line.startsWith("**Thank you to ")) |
| 179 | if (start < 0) return |
| 180 | return lines.slice(start).join("\n").trim() |
| 181 | } |
| 182 | |
| 183 | async function thanks(from: string, to: string, reuse: boolean) { |
| 184 | const release = reuse ? await published(to) : undefined |