CodeQL "Config file ... does not exist" configuration error in CI
The CodeQL init action resolves config-file relative to the repository checkout. If the path is wrong, or the code was not checked out yet, init fails with a configuration error before any analysis runs.
What this error means
The init step fails with "1 configuration error" and "Config file ... does not exist" naming the path you passed as config-file.
Error: 1 configuration error:
Config file /home/runner/work/app/app/.github/codeql/config.yml does not existCommon causes
Wrong or misspelled config-file path
The config-file value points to a path that does not exist in the repo, often a typo or a wrong directory.
Checkout runs after CodeQL init
If actions/checkout has not run (or removed the file), init cannot find the config on disk.
How to fix it
Fix the config-file path and checkout order
- Confirm the config file exists at the committed path.
- Ensure actions/checkout runs before the CodeQL init step.
- Pass the repo-relative path to
config-file.
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
with:
config-file: ./.github/codeql/config.ymlReference a config in another repo correctly
To use a shared config, give the owner/repo/path@ref form so CodeQL fetches it instead of expecting a local file.
config-file: my-org/shared/codeql/config.yml@mainHow to prevent it
- Keep the config at a stable committed path and reference it relatively.
- Run checkout before CodeQL init.
- Use the owner/repo/path@ref form for shared configs.