Skip to content

Commit

Permalink
More readable error message for invalid queries block
Browse files Browse the repository at this point in the history
When someone creates an invalid `queries` entry in the codeql config
file, like this:

```
queries:
  - foo.ql
```

THe error message is confusing, looking like this:

```
  Error: Cannot use 'in' operator to search for 'uses' in ql/ql/src
  TypeError: Cannot use 'in' operator to search for 'uses' in ql/ql/src
      at loadConfig (/home/runner/work/_actions/github/codeql-action/71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca/lib/config-utils.js:577:41)
```

With this change, the error message is more comprehensible:

`queries must be an array, with each entry having a 'uses' property`
  • Loading branch information
Andrew Eisenberg committed Aug 15, 2022
1 parent f9bce02 commit fba13b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
11 changes: 7 additions & 4 deletions lib/config-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fba13b0

Please sign in to comment.