Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

## [UNRELEASED]

No user facing changes.
- Default location for CodeQL configurations to be located and automatically loaded if present.

## 3.28.13 - 24 Mar 2025

Expand Down
9 changes: 8 additions & 1 deletion lib/init-action.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/init-action.js.map

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,22 @@ 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)}`,
);
}
Copy link
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
Member 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