Skip to content

Commit d50e3c7

Browse files
committed
Workflow: Add paths filter to QL for QL workflow
1 parent 48761b8 commit d50e3c7

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/ql-for-ql-build.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
paths:
9+
- "ql/**"
10+
- "**.qll"
11+
- "**.ql"
12+
- "**.dbscheme"
13+
- "**/qlpack.yml"
14+
- "**/qlpack.yml"
15+
- ".github/workflows/ql-for-ql-build.yml"
816

917
env:
1018
CARGO_TERM_COLOR: always
@@ -54,7 +62,7 @@ jobs:
5462
cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
5563
env:
5664
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
57-
65+
5866
### Build the extractor ###
5967
- name: Cache entire extractor
6068
if: steps.cache-pack.outputs.cache-hit != 'true'
@@ -116,14 +124,14 @@ jobs:
116124
- name: Create CodeQL config file
117125
run: |
118126
echo "paths-ignore:" >> ${CONF}
119-
echo " - ql/ql/test" >> ${CONF}
120-
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
127+
echo " - ql/ql/test" >> ${CONF}
128+
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
121129
echo "disable-default-queries: true" >> ${CONF}
122130
echo "queries:" >> ${CONF}
123131
echo " - uses: ./ql/ql/src/codeql-suites/ql-code-scanning.qls" >> ${CONF}
124132
echo "Config file: "
125133
cat ${CONF}
126-
env:
134+
env:
127135
CONF: ./ql-for-ql-config.yml
128136
- name: Initialize CodeQL
129137
uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
@@ -139,13 +147,13 @@ jobs:
139147

140148
- name: Perform CodeQL Analysis
141149
uses: github/codeql-action/analyze@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
142-
with:
150+
with:
143151
category: "ql-for-ql"
144152
- name: Copy sarif file to CWD
145153
run: cp ../results/ql.sarif ./ql-for-ql.sarif
146154
- name: Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
147155
run: |
148-
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
156+
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
149157
- name: Sarif as artifact
150158
uses: actions/upload-artifact@v3
151159
with:

0 commit comments

Comments
 (0)