Skip to content

Commit 8b1030f

Browse files
committed
fix: fetch versions from release instead of tags
1 parent 4cf2771 commit 8b1030f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/installer.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import io = require("@actions/io");
2424
const osPlat: string = os.platform();
2525
const osArch: string = os.arch();
2626

27-
interface ITaskRef {
28-
ref: string;
27+
interface ITaskRelease {
28+
tag_name: string;
2929
}
3030

3131
// Retrieve a list of versions scraping tags from the Github API
@@ -39,16 +39,14 @@ async function fetchVersions(repoToken: string): Promise<string[]> {
3939
rest = new restm.RestClient("setup-task");
4040
}
4141

42-
const tags: ITaskRef[] =
42+
const tags: ITaskRelease[] =
4343
(
44-
await rest.get<ITaskRef[]>(
45-
"https://api.github.com/repos/go-task/task/git/refs/tags",
44+
await rest.get<ITaskRelease[]>(
45+
"https://api.github.com/repos/go-task/task/releases",
4646
)
4747
).result || [];
4848

49-
return tags
50-
.filter((tag) => tag.ref.match(/v\d+\.[\w\.]+/g))
51-
.map((tag) => tag.ref.replace("refs/tags/v", ""));
49+
return tags.map((tag) => tag.tag_name);
5250
}
5351

5452
// Make partial versions semver compliant.

0 commit comments

Comments
 (0)