Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hide error message and stack for non-error
Avoid printing the error message and stack when we fail to find the
commit. This will happen in several non-error states (e.g.,
when there is no repository checked out at the CWD). Move the
error message to a debug message so that it is still available
if someone really wants to see it.
Andrew Eisenberg committed Jan 17, 2023
1 parent 32be38e commit b625b62
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map
5 changes: 3 additions & 2 deletions src/actions-util.ts
@@ -88,9 +88,10 @@ export const getCommitOid = async function (
return commitOid.trim();
} catch (e) {
core.info(
`Failed to call git to get current commit. Continuing with data from environment or input: ${e}`
"Could not determine current commit SHA. Continuing with data from the environment."
);
core.info((e as Error).stack || "NO STACK");
core.debug(`Reason: ${(e as Error).message}`);
core.debug((e as Error).stack || "NO STACK");
return getOptionalInput("sha") || getRequiredEnvParam("GITHUB_SHA");
}
};

0 comments on commit b625b62

Please sign in to comment.