Skip to content

Commit 1fc1bb9

Browse files
committed
fix: get tags from github
1 parent 60c2017 commit 1fc1bb9

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/release.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ export class ReleaseTracker {
2525
}
2626

2727
async fetchAllTags(): Promise<string[]> {
28-
const response = await this.octokit.request(
29-
`GET /repos/${this.config.repository}/git/ref/tags`
30-
)
28+
const owner = this.config.repository.split('/')[0]
29+
const repoName = this.config.repository.split('/').slice(1).join('/')
30+
31+
const response = await this.octokit.rest.git.listMatchingRefs({
32+
owner: owner,
33+
repo: repoName,
34+
ref: 'tags'
35+
})
3136

3237
const tags = (response.data as { ref: string }[]).map(tag =>
3338
tag.ref.replace('refs/tags/', '')

src/sdk/linear-changeset.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ export class LinearChangesetSdk {
5858

5959
const json = (await response.json()) as GetProjectVersionsResponse
6060

61+
if (!json.releases) {
62+
core.info(`No tags found`)
63+
return []
64+
}
65+
6166
json.releases.forEach(r => {
6267
core.info(`Found tag: ${r.appName} ${r.version}`)
6368
})

0 commit comments

Comments
 (0)