Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,24 @@ async function run() {

core.exportVariable(EnvVar.INIT_ACTION_HAS_RUN, "true");

const configFile = getOptionalInput("config-file");
let configFile = getOptionalInput("config-file");
if (configFile === undefined) {
const defaultLocation = path.join(
getRequiredEnvParam("GITHUB_WORKSPACE"),
".github",
"codeql",
"codeql.yml",
);

if (fs.existsSync(defaultLocation)) {
configFile = defaultLocation;
logger.info(
`Using default config file location: ${path.resolve(configFile)}`,
);
} else {
logger.info("No config file found.");
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious whether it would make sense to add a log message if the default file fails to be found, to warn both the users and us when debugging that something has gone very wrong.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually added it in the first commit but thought it would almost always trigger a log that no config was used. I'm okay with either personally

}

try {
const statusReportBase = await createStatusReportBase(
Expand Down
Loading