fix js errors
This commit is contained in:
parent
f9c679304b
commit
9758476685
@ -37,8 +37,7 @@ export function gather_information(debug = false, output = false) {
|
|||||||
try {
|
try {
|
||||||
const stripTagPrefix = core.getInput("strip_tag_prefix");
|
const stripTagPrefix = core.getInput("strip_tag_prefix");
|
||||||
|
|
||||||
if (debug) console.log(JSON.stringify(github.context));
|
if (debug) console.log(JSON.stringify(github.context, null, 2));
|
||||||
if (debug) console.log("github.context.ref=" + github.context.ref);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -56,8 +55,8 @@ export function gather_information(debug = false, output = false) {
|
|||||||
r.git_is_branch = true;
|
r.git_is_branch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// gather regular branch info, also applies to tags
|
// gather regular branch info
|
||||||
if (r.git_is_tag || 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",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user