Skip to content

Commit b611b51

Browse files
committed
QL: make another codeql-action workflow that uses a published pack
1 parent 4e73b9a commit b611b51

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

.github/workflows/codeql-analysis.yml renamed to .github/workflows/bleeding-codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL"
1+
name: "CodeQL with bleeding edge queries and extractor"
22

33
on:
44
workflow_dispatch:
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "CodeQL with published queries and extractor"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: [ main ]
10+
11+
jobs:
12+
13+
analyze:
14+
name: Analyze
15+
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
27+
- name: Download pack
28+
run: |
29+
gh release download latest --pattern ql-qlpack.zip
30+
unzip ql-qlpack.zip -d "${PACK}"
31+
env:
32+
PACK: ${{ runner.temp }}/ql-qlpack
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Hack codeql-action options
36+
run: |
37+
JSON=$(jq -nc --arg pack "${PACK}" '.resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
38+
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
39+
env:
40+
PACK: ${{ runner.temp }}/ql-qlpack
41+
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@esbena/ql
44+
with:
45+
languages: ql
46+
db-location: ${{ runner.temp }}/db
47+
48+
- name: Perform CodeQL Analysis
49+
uses: github/codeql-action/analyze@esbena/ql

0 commit comments

Comments
 (0)