Skip to content

Commit 682c4ee

Browse files
committed
don't do tag lookup istg
1 parent 9fbff1b commit 682c4ee

1 file changed

Lines changed: 7 additions & 17 deletions

File tree

packages/desktop/scripts/finalize-latest-json.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ const root = dir
2929
const token = process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN
3030
if (!token) throw new Error("GH_TOKEN or GITHUB_TOKEN is required")
3131

32-
const apiHeaders = {
33-
Authorization: `token ${token}`,
34-
Accept: "application/vnd.github+json",
35-
}
36-
37-
const releaseRes = await fetch(`https://api.github.com/repos/${repo}/releases/${releaseId}`, {
38-
headers: apiHeaders,
32+
const rel = await fetch(`https://api.github.com/repos/${repo}/releases/${releaseId}`, {
33+
headers: {
34+
Authorization: `token ${token}`,
35+
Accept: "application/vnd.github+json",
36+
},
3937
})
4038

41-
if (!releaseRes.ok) {
42-
throw new Error(`Failed to fetch release: ${releaseRes.status} ${releaseRes.statusText}`)
39+
if (!rel.ok) {
40+
throw new Error(`Failed to fetch release: ${rel.status} ${rel.statusText}`)
4341
}
4442

4543
type Asset = {
@@ -51,14 +49,6 @@ type Release = {
5149
assets?: Asset[]
5250
}
5351

54-
const rel = await fetch(`https://api.github.com/repos/${repo}/releases/tags/v${version}`, {
55-
headers: {
56-
Authorization: `token ${token}`,
57-
Accept: "application/vnd.github+json",
58-
},
59-
})
60-
if (!rel.ok) throw new Error(`Failed to fetch release: ${rel.status} ${rel.statusText}`)
61-
6252
const assets = ((await rel.json()) as Release).assets ?? []
6353
const amap = new Map(assets.map((item) => [item.name, item]))
6454

0 commit comments

Comments
 (0)