Update logging for debug purposes

This commit is contained in:
Joel Male 2020-08-26 10:25:43 +10:00
parent a2c63f8d08
commit d4413d8be7
9 changed files with 19 additions and 8 deletions

7
dist/index.js vendored
View File

@ -2174,10 +2174,13 @@ function run() {
url = core.getInput('url'); url = core.getInput('url');
headers = (_a = core.getInput('headers')) !== null && _a !== void 0 ? _a : ''; headers = (_a = core.getInput('headers')) !== null && _a !== void 0 ? _a : '';
body = (_b = core.getInput('body')) !== null && _b !== void 0 ? _b : ''; body = (_b = core.getInput('body')) !== null && _b !== void 0 ? _b : '';
core.info("Sending webhook request to " + url + "..."); core.info("Sending webhook request to " + url);
core.debug((new Date()).toTimeString()); core.debug((new Date()).toTimeString());
http_1.http.make(url, headers, body) http_1.http.make(url, headers, body)
.then(function (res) { return core.setOutput('statusCode', res.status); }); .then(function (res) {
core.setOutput('statusCode', res.status);
core.info("Received status code: " + res.status);
});
core.info((new Date()).toTimeString()); core.info((new Date()).toTimeString());
} }
catch (error) { catch (error) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

7
dist/main.js vendored
View File

@ -47,10 +47,13 @@ function run() {
url = core.getInput('url'); url = core.getInput('url');
headers = (_a = core.getInput('headers')) !== null && _a !== void 0 ? _a : ''; headers = (_a = core.getInput('headers')) !== null && _a !== void 0 ? _a : '';
body = (_b = core.getInput('body')) !== null && _b !== void 0 ? _b : ''; body = (_b = core.getInput('body')) !== null && _b !== void 0 ? _b : '';
core.info("Sending webhook request to " + url + "..."); core.info("Sending webhook request to " + url);
core.debug((new Date()).toTimeString()); core.debug((new Date()).toTimeString());
http_1.http.make(url, headers, body) http_1.http.make(url, headers, body)
.then(function (res) { return core.setOutput('statusCode', res.status); }); .then(function (res) {
core.setOutput('statusCode', res.status);
core.info("Received status code: " + res.status);
});
core.info((new Date()).toTimeString()); core.info((new Date()).toTimeString());
} }
catch (error) { catch (error) {

2
dist/main.js.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"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AI,SAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,mCAAI,EAAE,CAAC;gBAGzC,IAAI,CAAC,IAAI,CAAC,gCAA8B,GAAK,CAAC,CAAC;gBAG/C,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;gBAGxC,WAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC;qBAC1B,IAAI,CAAC,UAAC,GAAG;oBAER,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;oBAEzC,IAAI,CAAC,IAAI,CAAC,2BAAyB,GAAG,CAAC,MAAQ,CAAC,CAAC;gBACnD,CAAC,CAAC,CAAC;gBAGL,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;aACxC;YAAC,OAAO,KAAK,EAAE;gBACd,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aAC/B;;;;CACF;AAED,GAAG,EAAE,CAAC"}

Binary file not shown.

Binary file not shown.

View File

@ -8,14 +8,19 @@ async function run() {
const body = core.getInput('body') ?? ''; const body = core.getInput('body') ?? '';
// initial info // initial info
core.info(`Sending webhook request to ${url}...`); core.info(`Sending webhook request to ${url}`);
// debug start // debug start
core.debug((new Date()).toTimeString()); // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true core.debug((new Date()).toTimeString()); // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
// make the request // make the request
http.make(url, headers, body) http.make(url, headers, body)
.then((res) => core.setOutput('statusCode', res.status)); .then((res) => {
// output the status
core.setOutput('statusCode', res.status);
// report on the status code
core.info(`Received status code: ${res.status}`);
});
// debug end // debug end
core.info((new Date()).toTimeString()); core.info((new Date()).toTimeString());