@@ -3528,8 +3528,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3528
3528
const core = __importStar(__webpack_require__(470));
3529
3529
const github = __importStar(__webpack_require__(469));
3530
3530
const create_1 = __webpack_require__(646);
3531
+ // nullify getInput empty results
3532
+ // to allow coalescence ?? operator
3533
+ function getInput(name, options) {
3534
+ const result = core.getInput(name, options);
3535
+ if (result === '') {
3536
+ return null;
3537
+ }
3538
+ return result;
3539
+ }
3531
3540
function run() {
3532
- var _a, _b, _c, _d, _e;
3541
+ var _a, _b, _c, _d, _e, _f, _g ;
3533
3542
return __awaiter(this, void 0, void 0, function* () {
3534
3543
let token;
3535
3544
let type;
@@ -3545,22 +3554,22 @@ function run() {
3545
3554
console.log(`ref: ${ref}`);
3546
3555
try {
3547
3556
console.log('Inputs..');
3548
- token = core. getInput('token', { required: true });
3549
- type = core. getInput('type', { required: true });
3557
+ token = (_a = getInput('token', { required: true })) !== null && _a !== void 0 ? _a : '' ;
3558
+ type = getInput('type', { required: true });
3550
3559
console.log(`type: ${type}`);
3551
- logsUrl = (_a = core. getInput('logs')) !== null && _a !== void 0 ? _a : '';
3560
+ logsUrl = (_b = getInput('logs')) !== null && _b !== void 0 ? _b : '';
3552
3561
console.log(`logs: ${logsUrl}`);
3553
- description = (_b = core. getInput('description')) !== null && _b !== void 0 ? _b : `deployed by ${actor}`;
3562
+ description = (_c = getInput('description')) !== null && _c !== void 0 ? _c : `deployed by ${actor}`;
3554
3563
console.log(`description: ${description}`);
3555
- initialStatus = ((_c = core. getInput('initial_status')) !== null && _c !== void 0 ? _c : 'in_progress');
3564
+ initialStatus = ((_d = getInput('initial_status')) !== null && _d !== void 0 ? _d : 'in_progress');
3556
3565
console.log(`initialStatus: ${initialStatus}`);
3557
3566
// default to branch name w/o `deploy-` prefix
3558
- environment = (_d = core. getInput('environment')) !== null && _d !== void 0 ? _d : ( ref) .replace(/^ refs\ /heads/, '').replace(/^deploy-/, '');
3567
+ environment = (_e = getInput('environment')) !== null && _e !== void 0 ? _e : ref.replace(' refs/heads/' , '').replace(/^deploy-/, '');
3559
3568
console.log(`environment: ${environment}`);
3560
- environmentUrl = (_e = core. getInput('environment_url')) !== null && _e !== void 0 ? _e : '';
3569
+ environmentUrl = (_f = getInput('environment_url')) !== null && _f !== void 0 ? _f : '';
3561
3570
console.log(`environmentUrl: ${environmentUrl}`);
3562
3571
const shouldRequireDeploymentId = type === 'status' || type === 'delete';
3563
- deploymentId = core. getInput('deployment_id', { required: shouldRequireDeploymentId });
3572
+ deploymentId = (_g = getInput('deployment_id', { required: shouldRequireDeploymentId })) !== null && _g !== void 0 ? _g : '0' ;
3564
3573
}
3565
3574
catch (error) {
3566
3575
core.error(error);
0 commit comments