File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -505,8 +505,6 @@ export class AutoUpdater {
505505 . map ( ( l : any ) => l . name )
506506 . filter ( Boolean ) ;
507507
508- // Check that the label exists on the remote before applying it
509- let labelExists = true ;
510508 try {
511509 await this . octokit . rest . issues . getLabel ( {
512510 owner : mergeOpts . owner as string ,
@@ -522,16 +520,16 @@ export class AutoUpdater {
522520 ghCore . error (
523521 `Merge conflict label '${ mergeConflictLabel } ' does not exist on the remote. Skipping label application.` ,
524522 ) ;
525- labelExists = false ;
523+ throw err ;
526524 } else {
527525 ghCore . error (
528526 `Error checking for label '${ mergeConflictLabel } ': ${ err } ` ,
529527 ) ;
530- labelExists = false ;
528+ throw err ;
531529 }
532530 }
533531
534- if ( labelExists && ! currentLabels . includes ( mergeConflictLabel ) ) {
532+ if ( ! currentLabels . includes ( mergeConflictLabel ) ) {
535533 const newLabels = [ ...currentLabels , mergeConflictLabel ] ;
536534 await this . octokit . rest . issues . update ( {
537535 owner : mergeOpts . owner as string ,
@@ -542,10 +540,6 @@ export class AutoUpdater {
542540 ghCore . info (
543541 `Added merge conflict label '${ mergeConflictLabel } ' to PR #${ prNumber } .` ,
544542 ) ;
545- } else if ( ! labelExists ) {
546- ghCore . info (
547- `Did not add label '${ mergeConflictLabel } ' because it does not exist on the remote.` ,
548- ) ;
549543 } else {
550544 ghCore . info (
551545 `Merge conflict label '${ mergeConflictLabel } ' already present on PR #${ prNumber } .` ,
You can’t perform that action at this time.
0 commit comments