mirror of
https://github.com/github/codeql-action.git
synced 2026-11-08 14:09:51 +00:00
Verify persisted repository root path in analyze action
This commit is contained in:
13
lib/entry-points.js
generated
13
lib/entry-points.js
generated
@@ -153805,7 +153805,7 @@ var CodeQLAnalysisError = class extends Error {
|
||||
message;
|
||||
error;
|
||||
};
|
||||
async function determineCheckoutPath(action) {
|
||||
async function determineCheckoutPath(action, config) {
|
||||
const checkoutPathInput = action.actions.getRequiredInput("checkout_path");
|
||||
const repositoryRoot = await getGitRoot(checkoutPathInput);
|
||||
if (repositoryRoot === void 0) {
|
||||
@@ -153824,6 +153824,15 @@ async function determineCheckoutPath(action) {
|
||||
"Set the 'checkout_path' input for the 'codeql-action/analyze' step to the root path of the checkout."
|
||||
].join(" ")
|
||||
);
|
||||
} else if (config.repositoryRoot !== void 0 && repositoryRoot !== config.repositoryRoot) {
|
||||
action.logger.warning(
|
||||
[
|
||||
`The repository path at '${repositoryRoot}' does not match that found by the 'codeql-action/init' step: '${config.repositoryRoot}'.`,
|
||||
"Ensure that the 'checkout_path' input for the 'codeql-action/analyze' step is set to the path of the same repository that",
|
||||
"the 'codeql-action/init' step determined. This is either the GitHub Actions workspace or the repository root corresponding to",
|
||||
"the 'source-root' input if that was provided."
|
||||
].join(" ")
|
||||
);
|
||||
}
|
||||
return checkoutPathInput;
|
||||
}
|
||||
@@ -156638,7 +156647,7 @@ async function run(action) {
|
||||
getOptionalInput("ram") || process.env["CODEQL_RAM"],
|
||||
logger
|
||||
);
|
||||
const checkoutPath = await determineCheckoutPath(action);
|
||||
const checkoutPath = await determineCheckoutPath(action, config);
|
||||
const diffRangePackDir = await setupDiffInformedQueryRun(
|
||||
logger,
|
||||
checkoutPath
|
||||
|
||||
Reference in New Issue
Block a user