@@ -26561,6 +26561,10 @@ class GithubActions {
26561
26561
core.setOutput(name, output)
26562
26562
}
26563
26563
26564
+ setSecret(value) {
26565
+ core.setSecret(value)
26566
+ }
26567
+
26564
26568
setFailed(message) {
26565
26569
core.setFailed(message)
26566
26570
}
@@ -26591,6 +26595,57 @@ class LogActions {
26591
26595
module.exports = { GithubActions, LogActions }
26592
26596
26593
26597
26598
+ /***/ }),
26599
+
26600
+ /***/ 8566:
26601
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
26602
+
26603
+ "use strict";
26604
+
26605
+
26606
+ const axios = __nccwpck_require__(8757);
26607
+ const { GithubActions } = __nccwpck_require__(8169);
26608
+
26609
+ /**
26610
+ * @param {GithubActions} actions
26611
+ *
26612
+ * @returns {(response: axios.AxiosResponse) => void}
26613
+ */
26614
+ const createMaskHandler = (actions) => (response) => {
26615
+ let data = response.data
26616
+
26617
+ if (typeof data == 'object') {
26618
+ data = JSON.stringify(data)
26619
+ }
26620
+
26621
+ actions.setSecret(data)
26622
+ }
26623
+
26624
+ module.exports = { createMaskHandler }
26625
+
26626
+ /***/ }),
26627
+
26628
+ /***/ 2190:
26629
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
26630
+
26631
+ "use strict";
26632
+
26633
+
26634
+ const axios = __nccwpck_require__(8757);
26635
+ const { GithubActions } = __nccwpck_require__(8169);
26636
+
26637
+ /**
26638
+ * @param {GithubActions} actions
26639
+ *
26640
+ * @returns {(response: axios.AxiosResponse) => void}
26641
+ */
26642
+ const createOutputHandler = (actions) => (response) => {
26643
+ actions.setOutput('response', response.data)
26644
+ actions.setOutput('headers', response.headers)
26645
+ }
26646
+
26647
+ module.exports = { createOutputHandler }
26648
+
26594
26649
/***/ }),
26595
26650
26596
26651
/***/ 6733:
@@ -26840,9 +26895,6 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti
26840
26895
return null
26841
26896
}
26842
26897
26843
- actions.setOutput('response', JSON.stringify(response.data))
26844
- actions.setOutput('headers', response.headers)
26845
-
26846
26898
return response
26847
26899
} catch (error) {
26848
26900
if ((typeof error === 'object') && (error.isAxiosError === true)) {
@@ -33180,7 +33232,10 @@ const axios = __nccwpck_require__(8757);
33180
33232
const https = __nccwpck_require__(5687);
33181
33233
const { request, METHOD_POST } = __nccwpck_require__(9082);
33182
33234
const { GithubActions } = __nccwpck_require__(8169);
33235
+
33183
33236
const { createPersistHandler } = __nccwpck_require__(6733);
33237
+ const { createOutputHandler } = __nccwpck_require__(2190);
33238
+ const { createMaskHandler } = __nccwpck_require__(8566);
33184
33239
33185
33240
let customHeaders = {}
33186
33241
@@ -33248,9 +33303,16 @@ if (typeof ignoreStatusCodes === 'string' && ignoreStatusCodes.length > 0) {
33248
33303
ignoredCodes = ignoreStatusCodes.split(',').map(statusCode => parseInt(statusCode.trim()))
33249
33304
}
33250
33305
33251
- const handler = [];
33252
33306
const actions = new GithubActions();
33253
33307
33308
+ const handler = [];
33309
+
33310
+ if (core.getBooleanInput('maskResponse')) {
33311
+ handler.push(createMaskHandler(actions))
33312
+ }
33313
+
33314
+ handler.push(createOutputHandler(actions))
33315
+
33254
33316
if (!!responseFile) {
33255
33317
handler.push(createPersistHandler(responseFile, actions))
33256
33318
}
@@ -33264,7 +33326,7 @@ const options = {
33264
33326
}
33265
33327
33266
33328
request({ data, method, instanceConfig, files, file, actions, options }).then(response => {
33267
- if (typeof response == 'object') {
33329
+ if (response && typeof response == 'object') {
33268
33330
handler.forEach(h => h(response))
33269
33331
}
33270
33332
})
0 commit comments