Skip to content

Commit 64314ad

Browse files
authored
Add getting started
1 parent 7baa22e commit 64314ad

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
11
# Community Packs
22

33
Collection of community-driven CodeQL query and extension packs
4+
5+
## Getting started
6+
7+
### CodeQL packs syntax
8+
9+
Using `githubsecuritylab/codeql-LANG-queries` will reference the default suite for that pack (e.g. `python.qls` for python). However, you may use a different suite such as `python-audit.qls` by using the following syntax: `githubsecuritylab/codeql-python-queries:suites/python-audit.qls`. The examples below work for both situations.
10+
11+
### CodeQL Action
12+
13+
```yaml
14+
- name: Initialize CodeQL
15+
uses: github/codeql-action/init@v2
16+
with:
17+
languages: ${{ matrix.language }}
18+
packs: githubsecuritylab/codeql-${{ matrix.language }}-queries
19+
```
20+
21+
#### Via configuration file
22+
23+
```bash
24+
$ cat codeql-config.yml | grep -A 1 'packs:'
25+
packs:
26+
- githubsecuritylab/codeql-python-queries
27+
```
28+
29+
### CodeQL CLI
30+
31+
```bash
32+
codeql database analyze db/ --download githubsecuritylab/codeql-python-queries --format=sarif-latest --output=results.sarif
33+
```

0 commit comments

Comments
 (0)