File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ PR_NUMBER=${1}
5+
6+ codeql_db=" /tmp/codeql-test-database"
7+
8+ for file in $( gh pr view $PR_NUMBER --json files --jq ' .files.[].path' ) ; do
9+ if [[ ! -f " $file " ]]; then
10+ continue
11+ fi
12+
13+ # config file
14+ if [[ " $file " == configs/* .yml ]]; then
15+ echo " [+] Compiling Config :: $file "
16+
17+ if [[ -d " $codeql_db " ]]; then
18+ rm -rf " $codeql_db "
19+ fi
20+
21+ gh codeql database create \
22+ --source-root=./.github/scripts \
23+ --language=python \
24+ --codescanning-config=$file \
25+ " $codeql_db "
26+ fi
27+ done
Original file line number Diff line number Diff line change @@ -141,3 +141,25 @@ jobs:
141141 codeql pack install "${{ matrix.language }}/ext-library-sources/"
142142 codeql pack create "${{ matrix.language }}/ext-library-sources/"
143143
144+ configs :
145+ runs-on : ubuntu-latest
146+ needs : compile
147+
148+ steps :
149+ - uses : actions/checkout@v3
150+
151+ - uses : dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50
152+ id : changes
153+ with :
154+ filters : |
155+ src:
156+ - 'configs/**'
157+
158+ - name : " Check Configurations"
159+ if : steps.changes.outputs.src == 'true'
160+ env :
161+ GITHUB_TOKEN : ${{ github.token }}
162+ run : |
163+ ./.github/scripts/pr-configs.sh "${{ github.event.number }}"
164+
165+
You can’t perform that action at this time.
0 commit comments