clarify debug messages
This commit is contained in:
parent
664643a9d3
commit
26ec9eb688
67
dist/index.js
vendored
67
dist/index.js
vendored
@ -30780,6 +30780,7 @@ module.exports = parseParams
|
|||||||
/******/ // Return the exports of the module
|
/******/ // Return the exports of the module
|
||||||
/******/ return module.exports;
|
/******/ return module.exports;
|
||||||
/******/ }
|
/******/ }
|
||||||
|
|
||||||
/******/
|
/******/
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/******/ /* webpack/runtime/make namespace object */
|
/******/ /* webpack/runtime/make namespace object */
|
||||||
@ -30805,14 +30806,15 @@ var __webpack_exports__ = {};
|
|||||||
// ESM COMPAT FLAG
|
// ESM COMPAT FLAG
|
||||||
__nccwpck_require__.r(__webpack_exports__);
|
__nccwpck_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
|
|
||||||
var core = __nccwpck_require__(2186);
|
|
||||||
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
|
// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
|
||||||
var github = __nccwpck_require__(5438);
|
var github = __nccwpck_require__(5438);
|
||||||
|
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
|
||||||
|
var core = __nccwpck_require__(2186);
|
||||||
;// CONCATENATED MODULE: external "process"
|
;// CONCATENATED MODULE: external "process"
|
||||||
const external_process_namespaceObject = require("process");
|
const external_process_namespaceObject = require("process");
|
||||||
;// CONCATENATED MODULE: ./src/lib.js
|
;// CONCATENATED MODULE: ./src/lib.js
|
||||||
|
|
||||||
|
|
||||||
function result_to_output(results) {
|
function result_to_output(results) {
|
||||||
for (const key in results) {
|
for (const key in results) {
|
||||||
if (!results.hasOwnProperty(key)) {
|
if (!results.hasOwnProperty(key)) {
|
||||||
@ -30841,7 +30843,7 @@ const external_process_namespaceObject = require("process");
|
|||||||
r.ci_hostname = url.hostname;
|
r.ci_hostname = url.hostname;
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('results for output:', JSON.stringify(r, null, 2));
|
console.log('results for collect_ci:', JSON.stringify(r, null, 2));
|
||||||
}
|
}
|
||||||
if (output) {
|
if (output) {
|
||||||
result_to_output(r);
|
result_to_output(r);
|
||||||
@ -30850,7 +30852,7 @@ const external_process_namespaceObject = require("process");
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log('partial results before error: ', JSON.stringify(r, null, 2));
|
console.log('partial results for collect_ci before error: ', JSON.stringify(r, null, 2));
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
external_process_namespaceObject.exit(1);
|
external_process_namespaceObject.exit(1);
|
||||||
}
|
}
|
||||||
@ -31144,15 +31146,14 @@ const promises = {
|
|||||||
semver_minor : false,
|
semver_minor : false,
|
||||||
semver_patch : false,
|
semver_patch : false,
|
||||||
semver_build : false,
|
semver_build : false,
|
||||||
semver_pre: false,
|
semver_pre : false
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const stripTagPrefix = core.getInput("strip_tag_prefix");
|
// TODO actually strip tag prefix
|
||||||
|
const stripTagPrefix = core.getInput('strip_tag_prefix');
|
||||||
|
|
||||||
if (debug) console.log(JSON.stringify(github.context, null, 2));
|
r.git_is_tag = github.context.ref.startsWith('refs/tags/');
|
||||||
|
|
||||||
r.git_is_tag = github.context.ref.startsWith("refs/tags/");
|
|
||||||
r.git_default_branch = github.context.payload?.repository?.defaultBranch;
|
r.git_default_branch = github.context.payload?.repository?.defaultBranch;
|
||||||
r.git_is_pull_request = github.context.payload.pull_request != null;
|
r.git_is_pull_request = github.context.payload.pull_request != null;
|
||||||
|
|
||||||
@ -31160,32 +31161,39 @@ const promises = {
|
|||||||
const baseRef = github.context.baseRef || external_process_namespaceObject.env.BODY_REF;
|
const baseRef = github.context.baseRef || external_process_namespaceObject.env.BODY_REF;
|
||||||
const headRef =
|
const headRef =
|
||||||
github.context.payload?.pull_request?.head?.ref || external_process_namespaceObject.env.HEAD_REF;
|
github.context.payload?.pull_request?.head?.ref || external_process_namespaceObject.env.HEAD_REF;
|
||||||
if (debug) console.log("baseRef=" + baseRef);
|
if (debug) {
|
||||||
if (debug) console.log("headRef=" + headRef);
|
console.log('baseRef=' + baseRef);
|
||||||
|
}
|
||||||
|
if (debug) {
|
||||||
|
console.log('headRef=' + headRef);
|
||||||
|
}
|
||||||
// TODO support PR data
|
// TODO support PR data
|
||||||
} else if (!r.git_is_tag) {
|
}
|
||||||
|
else if (!r.git_is_tag) {
|
||||||
// regular branches
|
// regular branches
|
||||||
r.git_is_branch = true;
|
r.git_is_branch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// gather regular branch info
|
// gather regular branch info
|
||||||
if (r.git_is_branch) {
|
if (r.git_is_branch) {
|
||||||
if (!github.context.ref.startsWith("refs/heads/")) {
|
if (!github.context.ref.startsWith('refs/heads/')) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Failed to determine branch for non-PR and non-Tag action",
|
'Failed to determine branch for non-PR and non-Tag action'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
r.git_current_branch = github.context.ref.slice("refs/heads/".length);
|
r.git_current_branch = github.context.ref.slice('refs/heads/'.length);
|
||||||
r.git_ref_branch = r.git_current_branch; // same as current branch for non-PR, non-Tag
|
r.git_ref_branch = r.git_current_branch; // same as current branch for non-PR, non-Tag
|
||||||
r.git_is_default_branch = r.git_current_branch == r.git_default_branch;
|
r.git_is_default_branch = r.git_current_branch == r.git_default_branch;
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse semver for tags
|
// parse semver for tags
|
||||||
if (r.git_is_tag) {
|
if (r.git_is_tag) {
|
||||||
r.git_tag = github.context.ref.slice("refs/tags/".length);
|
r.git_tag = github.context.ref.slice('refs/tags/'.length);
|
||||||
|
|
||||||
const parsed = parseSemVer(r.git_tag);
|
const parsed = parseSemVer(r.git_tag);
|
||||||
if (debug) console.log("semver=" + JSON.stringify(parsed));
|
if (debug) {
|
||||||
|
console.log('semver=' + JSON.stringify(parsed));
|
||||||
|
}
|
||||||
|
|
||||||
if (parsed.matches) {
|
if (parsed.matches) {
|
||||||
r.semver_valid = parsed.matches;
|
r.semver_valid = parsed.matches;
|
||||||
@ -31195,9 +31203,12 @@ const promises = {
|
|||||||
r.semver_build = parsed.build;
|
r.semver_build = parsed.build;
|
||||||
r.semver_pre = parsed.pre;
|
r.semver_pre = parsed.pre;
|
||||||
}
|
}
|
||||||
} else if (r.git_is_branch) {
|
}
|
||||||
|
else if (r.git_is_branch) {
|
||||||
const parsed = parseSemVer(r.git_current_branch);
|
const parsed = parseSemVer(r.git_current_branch);
|
||||||
if (debug) console.log("semver=" + JSON.stringify(parsed));
|
if (debug) {
|
||||||
|
console.log('semver=' + JSON.stringify(parsed));
|
||||||
|
}
|
||||||
|
|
||||||
if (parsed.matches) {
|
if (parsed.matches) {
|
||||||
r.semver_valid = parsed.matches;
|
r.semver_valid = parsed.matches;
|
||||||
@ -31209,12 +31220,17 @@ const promises = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug) console.log("results for output:", JSON.stringify(r, null, 2));
|
if (debug) {
|
||||||
if (output) result_to_output(r);
|
console.log('results for collect_git:', JSON.stringify(r, null, 2));
|
||||||
|
}
|
||||||
|
if (output) {
|
||||||
|
result_to_output(r);
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
} catch (error) {
|
}
|
||||||
console.log("partial results before error: ", JSON.stringify(r, null, 2));
|
catch (error) {
|
||||||
|
console.log('partial results for collect_git before error: ', JSON.stringify(r, null, 2));
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
external_process_namespaceObject.exit(1);
|
external_process_namespaceObject.exit(1);
|
||||||
}
|
}
|
||||||
@ -31224,6 +31240,11 @@ const promises = {
|
|||||||
|
|
||||||
|
|
||||||
function collect_all(debug = false, output = false) {
|
function collect_all(debug = false, output = false) {
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
console.log(JSON.stringify(github.context, null, 2));
|
||||||
|
}
|
||||||
|
|
||||||
collect_ci(debug, output);
|
collect_ci(debug, output);
|
||||||
collect_git(debug, output);
|
collect_git(debug, output);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export function collect_ci(debug = false, output = false) {
|
|||||||
r.ci_hostname = url.hostname;
|
r.ci_hostname = url.hostname;
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('results for output:', JSON.stringify(r, null, 2));
|
console.log('results for collect_ci:', JSON.stringify(r, null, 2));
|
||||||
}
|
}
|
||||||
if (output) {
|
if (output) {
|
||||||
result_to_output(r);
|
result_to_output(r);
|
||||||
@ -22,7 +22,7 @@ export function collect_ci(debug = false, output = false) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log('partial results before error: ', JSON.stringify(r, null, 2));
|
console.log('partial results for collect_ci before error: ', JSON.stringify(r, null, 2));
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,7 @@ export function collect_git(debug = false, output = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
console.log('results for output:', JSON.stringify(r, null, 2));
|
console.log('results for collect_git:', JSON.stringify(r, null, 2));
|
||||||
}
|
}
|
||||||
if (output) {
|
if (output) {
|
||||||
result_to_output(r);
|
result_to_output(r);
|
||||||
@ -102,7 +102,7 @@ export function collect_git(debug = false, output = false) {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log("partial results before error: ", JSON.stringify(r, null, 2));
|
console.log('partial results for collect_git before error: ', JSON.stringify(r, null, 2));
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user