Skip to content

Commit

Permalink
fix: duplicate v
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed Jul 29, 2024
1 parent 4d53c4d commit 0d021b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function getDownloadUrl(options: Input): Promise<string> {
(tag) =>
tag.ref.startsWith("refs/tags/bun-v") || tag.ref === "refs/tags/canary"
)
.map((item) => item.ref.replace(/refs\/tags\/(bun-)?/g, ""));
.map((item) => item.ref.replace(/refs\/tags\/(bun-v)?/g, ""));

const { version, os, arch, avx2, profile } = options;

Expand All @@ -180,7 +180,7 @@ async function getDownloadUrl(options: Input): Promise<string> {
tags = tags.filter((t) => validate(t)).sort(compareVersions);

if (version === "latest") tag = `bun-v${tags.at(-1)}`;
else tag = `bun-${tags.filter((t) => satisfies(t, version)).at(-1)}`;
else tag = `bun-v${tags.filter((t) => satisfies(t, version)).at(-1)}`;
}

const eversion = encodeURIComponent(tag ?? version);
Expand Down

0 comments on commit 0d021b0

Please sign in to comment.