Skip to content

Commit c87f302

Browse files
author
Simon Engledew
committed
Expand readme to include codeql-path output example
Also add example from README into workflow to confirm it is accurate.
1 parent 54f3e52 commit c87f302

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: ./init
18+
id: init
1819
with:
1920
languages: javascript
2021
config-file: ./.github/codeql/codeql-config.yml
22+
# example from README.md
23+
- name: Print CodeQL Version
24+
run: ${{steps.init.outputs.codeql-path}} version --format=json
2125
- uses: ./analyze

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,24 @@ By default, this will override any queries specified in a config file. If you wi
125125
queries: +<local-or-remote-query>,<another-query>
126126
```
127127

128-
### CodeQL Path
128+
### Calling CodeQL Directly
129129

130130
The `init` action makes the path to CodeQL available as the output `codeql-path`.
131131

132+
With this you can access the `codeql` binary:
133+
134+
<!-- this example is run via .github/workflows/codeql.yml -->
135+
```yaml
136+
- name: Initialize CodeQL
137+
uses: github/codeql-action/init@v1
138+
id: init
139+
with:
140+
languages: javascript
141+
142+
- name: Print CodeQL Version
143+
run: ${{steps.init.outputs.codeql-path}} version --format=json
144+
```
145+
132146
## Troubleshooting
133147

134148
Read about [troubleshooting code scanning](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning).

0 commit comments

Comments
 (0)