Skip to content

Commit 79c79f1

Browse files
Edoardo Pirovanoedoardopirovano
Edoardo Pirovano
authored andcommitted
Add configuration option to set CodeQL DB location
1 parent feccdcb commit 79c79f1

38 files changed

+133
-79
lines changed

.github/workflows/pr-checks.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@ jobs:
5959
mv ../action/tests/multi-language-repo/{*,.github} .
6060
mv ../action/.github/workflows .github
6161
- uses: ./../action/init
62+
with:
63+
db-location: "${{ runner.temp }}/customDbLocation"
6264
- name: Build code
6365
shell: bash
6466
run: ./build.sh
6567
- uses: ./../action/analyze
6668
env:
6769
TEST_MODE: true
6870
- run: |
69-
cd "$RUNNER_TEMP/codeql_databases"
71+
cd "$RUNNER_TEMP/customDbLocation"
7072
# List all directories as there will be precisely one directory per database
7173
# but there may be other files in this directory such as query suites.
7274
if [ "$(ls -d */ | wc -l)" != 6 ] || \
@@ -261,6 +263,12 @@ jobs:
261263
- uses: ./../action/analyze
262264
env:
263265
TEST_MODE: true
266+
- run: |
267+
cd "$RUNNER_TEMP/codeql_databases"
268+
if [[ ! -d go ]]; then
269+
echo "Did not find a Go database"
270+
exit 1
271+
fi
264272
265273
multi-language-repo_rubocop:
266274
needs: [check-js, check-node-modules]

init/action.yml

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ inputs:
1616
config-file:
1717
description: Path of the config file to use
1818
required: false
19+
db-location:
20+
description: Path where CodeQL databases should be created. If not specified, a temporary directory will be used.
21+
required: false
1922
queries:
2023
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
2124
required: false

lib/analysis-paths.test.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analysis-paths.test.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)