@@ -160,11 +160,16 @@ export async function runPublish({
160160 const tagName = `${ pkg . packageJson . name } @${ pkg . packageJson . version } ` ;
161161 // Tag will only be created locally,
162162 // Create it using the GitHub API so it's signed.
163- await octokit . rest . git . createRef ( {
164- ...github . context . repo ,
165- ref : `refs/tags/${ tagName } ` ,
166- sha : github . context . sha ,
167- } ) ;
163+ await octokit . rest . git
164+ . createRef ( {
165+ ...github . context . repo ,
166+ ref : `refs/tags/${ tagName } ` ,
167+ sha : github . context . sha ,
168+ } )
169+ . catch ( ( err ) => {
170+ // Assuming tag was manually pushed in custom publish script
171+ core . warning ( `Failed to create tag ${ tagName } : ${ err . message } ` ) ;
172+ } ) ;
168173 if ( createGithubReleases ) {
169174 await createRelease ( octokit , { pkg, tagName } ) ;
170175 }
@@ -189,11 +194,16 @@ export async function runPublish({
189194 const tagName = `v${ pkg . packageJson . version } ` ;
190195 // Tag will only be created locally,
191196 // Create it using the GitHub API so it's signed.
192- await octokit . rest . git . createRef ( {
193- ...github . context . repo ,
194- ref : `refs/tags/${ tagName } ` ,
195- sha : github . context . sha ,
196- } ) ;
197+ await octokit . rest . git
198+ . createRef ( {
199+ ...github . context . repo ,
200+ ref : `refs/tags/${ tagName } ` ,
201+ sha : github . context . sha ,
202+ } )
203+ . catch ( ( err ) => {
204+ // Assuming tag was manually pushed in custom publish script
205+ core . warning ( `Failed to create tag ${ tagName } : ${ err . message } ` ) ;
206+ } ) ;
197207 if ( createGithubReleases ) {
198208 await createRelease ( octokit , { pkg, tagName } ) ;
199209 }
0 commit comments