We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26d1692 commit cf6e2d4Copy full SHA for cf6e2d4
src/targets/github.ts
@@ -127,10 +127,21 @@ export class GitHubTarget extends BaseTarget {
127
};
128
}
129
130
- const { data: latestRelease } = await this.github.repos.getLatestRelease({
131
- owner: this.githubConfig.owner,
132
- repo: this.githubConfig.repo,
133
- });
+ let latestRelease: { tag_name: string } | undefined;
+ try {
+ latestRelease = (
+ await this.github.repos.getLatestRelease({
134
+ owner: this.githubConfig.owner,
135
+ repo: this.githubConfig.repo,
136
+ })
137
+ ).data;
138
+ } catch (error) {
139
+ // if the error is a 404 error, it means that no release exists yet
140
+ // all other errors should be rethrown
141
+ if (error.status !== 404) {
142
+ throw error;
143
+ }
144
145
146
const isLatest = isPreview
147
? false
0 commit comments