Skip to content
Latchkey

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.

CodeQL
Error: 1 configuration error:
Config file /home/runner/work/app/app/.github/codeql/config.yml does not exist

Common 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

  1. Confirm the config file exists at the committed path.
  2. Ensure actions/checkout runs before the CodeQL init step.
  3. Pass the repo-relative path to config-file.
.github/workflows/codeql.yml
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
  with:
    config-file: ./.github/codeql/config.yml

Reference 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.

.github/workflows/codeql.yml
config-file: my-org/shared/codeql/config.yml@main

How 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.

Frequently asked questions

What causes ""Config file ... does not exist""?
The config-file value points to a path that does not exist in the repo, often a typo or a wrong directory.
How do I fix "Config file ... does not exist"?
Fix the config-file path and checkout order

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card