@@ -536,6 +536,7 @@ function whichSync (cmd, opt) {
536
536
// We use any as a valid input type
537
537
/* eslint-disable @typescript-eslint/no-explicit-any */
538
538
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
539
+ exports . toCommandValue = void 0 ;
539
540
/**
540
541
* Sanitizes an input into a string so it can be passed into issueCommand safely
541
542
* @param input input to sanitize into a string
@@ -567,14 +568,27 @@ module.exports = require("os");
567
568
"use strict" ;
568
569
569
570
// For internal use, subject to change.
571
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
572
+ if ( k2 === undefined ) k2 = k ;
573
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
574
+ } ) : ( function ( o , m , k , k2 ) {
575
+ if ( k2 === undefined ) k2 = k ;
576
+ o [ k2 ] = m [ k ] ;
577
+ } ) ) ;
578
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
579
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
580
+ } ) : function ( o , v ) {
581
+ o [ "default" ] = v ;
582
+ } ) ;
570
583
var __importStar = ( this && this . __importStar ) || function ( mod ) {
571
584
if ( mod && mod . __esModule ) return mod ;
572
585
var result = { } ;
573
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
574
- result [ "default" ] = mod ;
586
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
587
+ __setModuleDefault ( result , mod ) ;
575
588
return result ;
576
589
} ;
577
590
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
591
+ exports . issueCommand = void 0 ;
578
592
// We use any as a valid input type
579
593
/* eslint-disable @typescript-eslint/no-explicit-any */
580
594
const fs = __importStar ( __webpack_require__ ( 747 ) ) ;
@@ -1158,7 +1172,7 @@ function run() {
1158
1172
const github = github_1 . getOctokit ( githubToken , { } ) ;
1159
1173
if ( payload . pull_request ) {
1160
1174
const pr = yield github . pulls . get ( Object . assign ( Object . assign ( { } , repo ) , { pull_number : payload . pull_request . number } ) ) ;
1161
- if ( payload . action === 'opened' && pr . data . merged ) {
1175
+ if ( payload . action === 'opened' || payload . action === 'reopened' ) {
1162
1176
yield ensure_label_1 . addPullRequestLabel ( github , repo , pr . data ) ;
1163
1177
}
1164
1178
}
@@ -1490,14 +1504,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
1490
1504
exports . addPullRequestLabel = void 0 ;
1491
1505
function addPullRequestLabel ( github , request , pr ) {
1492
1506
return __awaiter ( this , void 0 , void 0 , function * ( ) {
1507
+ console . log ( `pr title: ${ pr . title } ` ) ;
1493
1508
const title = pr . title . split ( ':' ) [ 0 ] . trim ( ) ;
1494
- const titleLabel = pr . labels . filter ( z => z . name . includes ( title ) ) ;
1509
+ var labelsForRepository = yield github . issues . listLabelsForRepo ( Object . assign ( { } , request ) ) ;
1510
+ const titleLabel = labelsForRepository . data . filter ( z => z . name . includes ( title ) ) . map ( x => x . name ) ;
1495
1511
const hasLabel = titleLabel . length > 0 ;
1496
1512
console . log ( `label ${ hasLabel ? 'found' : 'not found' } ` , pr . labels ) ;
1497
- if ( hasLabel )
1513
+ if ( ! hasLabel )
1498
1514
return ;
1499
1515
console . log ( 'adding title label' , titleLabel ) ;
1500
- yield github . issues . addLabels ( Object . assign ( Object . assign ( { } , request ) , { issue_number : pr . number , labels : titleLabel . map ( z => z . name ) } ) ) ;
1516
+ yield github . issues . addLabels ( Object . assign ( Object . assign ( { } , request ) , { issue_number : pr . number , labels : titleLabel } ) ) ;
1501
1517
} ) ;
1502
1518
}
1503
1519
exports . addPullRequestLabel = addPullRequestLabel ;
@@ -1959,14 +1975,27 @@ function errname(uv, code) {
1959
1975
1960
1976
"use strict" ;
1961
1977
1978
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
1979
+ if ( k2 === undefined ) k2 = k ;
1980
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
1981
+ } ) : ( function ( o , m , k , k2 ) {
1982
+ if ( k2 === undefined ) k2 = k ;
1983
+ o [ k2 ] = m [ k ] ;
1984
+ } ) ) ;
1985
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
1986
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
1987
+ } ) : function ( o , v ) {
1988
+ o [ "default" ] = v ;
1989
+ } ) ;
1962
1990
var __importStar = ( this && this . __importStar ) || function ( mod ) {
1963
1991
if ( mod && mod . __esModule ) return mod ;
1964
1992
var result = { } ;
1965
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
1966
- result [ "default" ] = mod ;
1993
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
1994
+ __setModuleDefault ( result , mod ) ;
1967
1995
return result ;
1968
1996
} ;
1969
1997
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1998
+ exports . issue = exports . issueCommand = void 0 ;
1970
1999
const os = __importStar ( __webpack_require__ ( 87 ) ) ;
1971
2000
const utils_1 = __webpack_require__ ( 82 ) ;
1972
2001
/**
@@ -4081,6 +4110,25 @@ exports.getOctokit = getOctokit;
4081
4110
4082
4111
"use strict" ;
4083
4112
4113
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
4114
+ if ( k2 === undefined ) k2 = k ;
4115
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
4116
+ } ) : ( function ( o , m , k , k2 ) {
4117
+ if ( k2 === undefined ) k2 = k ;
4118
+ o [ k2 ] = m [ k ] ;
4119
+ } ) ) ;
4120
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
4121
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
4122
+ } ) : function ( o , v ) {
4123
+ o [ "default" ] = v ;
4124
+ } ) ;
4125
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
4126
+ if ( mod && mod . __esModule ) return mod ;
4127
+ var result = { } ;
4128
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
4129
+ __setModuleDefault ( result , mod ) ;
4130
+ return result ;
4131
+ } ;
4084
4132
var __awaiter = ( this && this . __awaiter ) || function ( thisArg , _arguments , P , generator ) {
4085
4133
function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
4086
4134
return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
@@ -4090,14 +4138,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
4090
4138
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
4091
4139
} ) ;
4092
4140
} ;
4093
- var __importStar = ( this && this . __importStar ) || function ( mod ) {
4094
- if ( mod && mod . __esModule ) return mod ;
4095
- var result = { } ;
4096
- if ( mod != null ) for ( var k in mod ) if ( Object . hasOwnProperty . call ( mod , k ) ) result [ k ] = mod [ k ] ;
4097
- result [ "default" ] = mod ;
4098
- return result ;
4099
- } ;
4100
4141
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
4142
+ exports . getState = exports . saveState = exports . group = exports . endGroup = exports . startGroup = exports . info = exports . warning = exports . error = exports . debug = exports . isDebug = exports . setFailed = exports . setCommandEcho = exports . setOutput = exports . getBooleanInput = exports . getInput = exports . addPath = exports . setSecret = exports . exportVariable = exports . ExitCode = void 0 ;
4101
4143
const command_1 = __webpack_require__ ( 431 ) ;
4102
4144
const file_command_1 = __webpack_require__ ( 102 ) ;
4103
4145
const utils_1 = __webpack_require__ ( 82 ) ;
@@ -4164,7 +4206,9 @@ function addPath(inputPath) {
4164
4206
}
4165
4207
exports . addPath = addPath ;
4166
4208
/**
4167
- * Gets the value of an input. The value is also trimmed.
4209
+ * Gets the value of an input.
4210
+ * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
4211
+ * Returns an empty string if the value is not defined.
4168
4212
*
4169
4213
* @param name name of the input to get
4170
4214
* @param options optional. See InputOptions.
@@ -4175,9 +4219,34 @@ function getInput(name, options) {
4175
4219
if ( options && options . required && ! val ) {
4176
4220
throw new Error ( `Input required and not supplied: ${ name } ` ) ;
4177
4221
}
4222
+ if ( options && options . trimWhitespace === false ) {
4223
+ return val ;
4224
+ }
4178
4225
return val . trim ( ) ;
4179
4226
}
4180
4227
exports . getInput = getInput ;
4228
+ /**
4229
+ * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
4230
+ * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
4231
+ * The return value is also in boolean type.
4232
+ * ref: https://yaml.org/spec/1.2/spec.html#id2804923
4233
+ *
4234
+ * @param name name of the input to get
4235
+ * @param options optional. See InputOptions.
4236
+ * @returns boolean
4237
+ */
4238
+ function getBooleanInput ( name , options ) {
4239
+ const trueValue = [ 'true' , 'True' , 'TRUE' ] ;
4240
+ const falseValue = [ 'false' , 'False' , 'FALSE' ] ;
4241
+ const val = getInput ( name , options ) ;
4242
+ if ( trueValue . includes ( val ) )
4243
+ return true ;
4244
+ if ( falseValue . includes ( val ) )
4245
+ return false ;
4246
+ throw new TypeError ( `Input does not meet YAML 1.2 "Core Schema" specification: ${ name } \n` +
4247
+ `Support boolean input list: \`true | True | TRUE | false | False | FALSE\`` ) ;
4248
+ }
4249
+ exports . getBooleanInput = getBooleanInput ;
4181
4250
/**
4182
4251
* Sets the value of an output.
4183
4252
*
@@ -4186,6 +4255,7 @@ exports.getInput = getInput;
4186
4255
*/
4187
4256
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4188
4257
function setOutput ( name , value ) {
4258
+ process . stdout . write ( os . EOL ) ;
4189
4259
command_1 . issueCommand ( 'set-output' , { name } , value ) ;
4190
4260
}
4191
4261
exports . setOutput = setOutput ;
@@ -5112,7 +5182,9 @@ class HttpClient {
5112
5182
maxSockets : maxSockets ,
5113
5183
keepAlive : this . _keepAlive ,
5114
5184
proxy : {
5115
- proxyAuth : `${ proxyUrl . username } :${ proxyUrl . password } ` ,
5185
+ ...( ( proxyUrl . username || proxyUrl . password ) && {
5186
+ proxyAuth : `${ proxyUrl . username } :${ proxyUrl . password } `
5187
+ } ) ,
5116
5188
host : proxyUrl . hostname ,
5117
5189
port : proxyUrl . port
5118
5190
}
0 commit comments