@@ -65,7 +65,7 @@ if (!process.env.CDN_BUCKET_NAME) {
65
65
const { CDN_BUCKET_NAME } = process . env
66
66
67
67
if ( ! process . env . GITHUB_TOKEN && ! isDryRun ) {
68
- throw new Error ( 'You are missing an environment variable GITHUB_TOKEN.' )
68
+ console . warn ( 'You are missing an environment variable GITHUB_TOKEN. The github release will not be created .' )
69
69
}
70
70
71
71
console . log ( 'I will now process the files:' )
@@ -141,17 +141,20 @@ if (!isDryRun) {
141
141
142
142
const semverRegex = / ^ v [ 0 - 9 ] + \. [ 0 - 9 ] + \. [ 0 - 9 ] + ( - b e t a \. [ 0 - 9 ] + ) ? $ /
143
143
if ( semverRegex . test ( targetVersion ) ) {
144
- const ghRelease = await getReleaseForTag ( OWNER , REPO , targetVersion )
145
- console . log ( `I have found the latest version to be: ${ ghRelease . tag_name } named "${ ghRelease . name } ."` )
146
-
147
- console . log ( 'Appending CDN instructions to release description.' )
148
- if ( isDryRun ) {
149
- console . log ( 'Following would be added to the release notes:' )
150
- console . log ( '------' )
151
- console . log ( cdnLinks . join ( '\n' ) )
152
- console . log ( '------' )
153
- } else {
154
- await patchGithubReleaseBody ( ghRelease , ghRelease . body + cdnLinks . join ( '\n' ) )
155
- console . log ( `Please verify that instructions are correct by navigating to: ${ ghRelease . html_url } ` )
144
+ console . log ( 'Following will be added to the release notes:' )
145
+ console . log ( '------' )
146
+ console . log ( cdnLinks . join ( '\n' ) )
147
+ console . log ( '------' )
148
+
149
+ try {
150
+ const ghRelease = await getReleaseForTag ( OWNER , REPO , targetVersion )
151
+ console . log ( `I have found the latest version to be: ${ ghRelease . tag_name } named "${ ghRelease . name } ."` )
152
+ console . log ( 'Appending CDN instructions to release description.' )
153
+ if ( ! isDryRun ) {
154
+ await patchGithubReleaseBody ( ghRelease , ghRelease . body + cdnLinks . join ( '\n' ) )
155
+ console . log ( `Please verify that instructions are correct by navigating to: ${ ghRelease . html_url } ` )
156
+ }
157
+ } catch ( error ) {
158
+ console . error ( 'Failed to update release notes:' , error )
156
159
}
157
160
}
0 commit comments