File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,21 @@ export class GitHubTarget extends BaseTarget {
127
127
} ;
128
128
}
129
129
130
- const { data : latestRelease } = await this . github . repos . getLatestRelease ( {
131
- owner : this . githubConfig . owner ,
132
- repo : this . githubConfig . repo ,
133
- } ) ;
130
+ let latestRelease : { tag_name : string } | undefined ;
131
+ try {
132
+ latestRelease = (
133
+ 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
+ }
134
145
135
146
const isLatest = isPreview
136
147
? false
You can’t perform that action at this time.
0 commit comments