@@ -4,7 +4,7 @@ const child_process = require('child_process')
44const debug = require ( 'debug' ) ( 'attempt-backport' )
55const request = require ( 'request' )
66const node_repo = require ( '../lib/node-repo' )
7- const updatePrWithLabels = node_repo . updatePrWithLabels
7+ const fetchExistingThenUpdatePr = node_repo . fetchExistingThenUpdatePr
88const removeLabelFromPR = node_repo . removeLabelFromPR
99const getBotPrLabels = node_repo . getBotPrLabels
1010
@@ -132,7 +132,7 @@ function attemptBackport (options, version, isLTS, cb) {
132132 options . logger . debug ( `backport to ${ version } failed` )
133133
134134 if ( ! isLTS ) {
135- updatePrWithLabels ( options , [ `dont-land-on-v${ version } .x` ] )
135+ fetchExistingThenUpdatePr ( options , [ `dont-land-on-v${ version } .x` ] )
136136 } else {
137137 getBotPrLabels ( options , ( err , ourLabels ) => {
138138 if ( err ) {
@@ -223,7 +223,7 @@ function attemptBackport (options, version, isLTS, cb) {
223223 const cp = wrapCP ( 'git' , [ 'am' ] , { stdio : 'pipe' } , function done ( ) {
224224 // Success!
225225 if ( isLTS ) {
226- updatePrWithLabels ( options , [ `lts-watch-v${ version } .x` ] )
226+ fetchExistingThenUpdatePr ( options , [ `lts-watch-v${ version } .x` ] )
227227 } else {
228228 // TODO(Fishrock123): Re-enable this, but do a check first
229229 // to make sure the label was set by the bot only.
0 commit comments