Merge pull request #1485 from github/aeisenberg/comitoid-message

Hide error message and stack for non-error
This commit is contained in:
Andrew Eisenberg 2023-01-17 17:21:14 -08:00 committed by GitHub
commit 40cfcb0a3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 5 deletions

View file

@ -3,6 +3,9 @@
## [UNRELEASED]
- Python automatic dependency installation will no longer fail for projects using Poetry that specify `virtualenvs.options.no-pip = true` in their `poetry.toml`. [#1431](https://github.com/github/codeql-action/pull/1431).
- Avoid printing a stack trace and error message when the action fails to find the SHA at the
current directory. This will happen in several non-error states and so we now avoid cluttering the
log with this message. [#1485](https://github.com/github/codeql-action/pull/1485)
## 2.1.38 - 12 Jan 2023

5
lib/actions-util.js generated
View file

@ -88,8 +88,9 @@ const getCommitOid = async function (checkoutPath, ref = "HEAD") {
return commitOid.trim();
}
catch (e) {
core.info(`Failed to call git to get current commit. Continuing with data from environment or input: ${e}`);
core.info(e.stack || "NO STACK");
core.info("Could not determine current commit SHA using git. Continuing with data from user input or environment.");
core.debug(`Reason: ${e.message}`);
core.debug(e.stack || "NO STACK");
return (0, exports.getOptionalInput)("sha") || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");
}
};

File diff suppressed because one or more lines are too long

View file

@ -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 using git. Continuing with data from user input or 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");
}
};