@@ -2,12 +2,12 @@ name: "Code Scanning"
22
33on :
44 push :
5- branches : [ "main" ]
5+ branches : ["main"]
66 pull_request :
77 # The branches below must be a subset of the branches above
8- branches : [ "main" ]
8+ branches : ["main"]
99 schedule :
10- - cron : ' 39 12 * * 2'
10+ - cron : " 39 12 * * 2"
1111 workflow_dispatch :
1212
1313permissions :
1919jobs :
2020 analyze-javascript :
2121 name : Analyze
22- runs-on : ' ubuntu-latest'
22+ runs-on : " ubuntu-latest"
2323 permissions :
2424 actions : read
2525 contents : read
2626 security-events : write
2727
2828 steps :
29- - name : Checkout repository
30- uses : actions/checkout@v6
29+ - name : Checkout repository
30+ uses : actions/checkout@v6
3131
32- - name : Extract CodeQL bundle version from qlt.conf.json
33- run : |
34- echo "BUNDLE_VERSION=$(jq .CodeQLCLIBundle qlt.conf.json -r)" >> $GITHUB_ENV
32+ - name : Extract CodeQL bundle version from qlt.conf.json
33+ run : |
34+ echo "BUNDLE_VERSION=$(jq .CodeQLCLIBundle qlt.conf.json -r)" >> $GITHUB_ENV
3535
36- - name : Initialize CodeQL
37- id : initialize-codeql
38- uses : github/codeql-action/init@v4
39- env :
40- # Add our custom extractor to the CodeQL search path
41- CODEQL_ACTION_EXTRA_OPTIONS : ' {"database":{"init":["--search-path","${{ github.workspace }}/extractors"]}}'
42- with :
43- languages : javascript
44- config-file : ./.github/codeql/codeql-config.yaml
45- db-location : ${{ runner.temp }}/codeql-database
46- tools : https://github.com/github/codeql-action/releases/download/${{env.BUNDLE_VERSION}}/codeql-bundle-linux64.tar.gz
47- debug : true
36+ - name : Initialize CodeQL
37+ id : initialize-codeql
38+ uses : github/codeql-action/init@v4
39+ env :
40+ # Add our custom extractor to the CodeQL search path
41+ CODEQL_ACTION_EXTRA_OPTIONS : ' {"database":{"init":["--search-path","${{ github.workspace }}/extractors:${{ github.workspace }} "]}}'
42+ with :
43+ languages : javascript
44+ config-file : ./.github/codeql/codeql-config.yaml
45+ db-location : ${{ runner.temp }}/codeql-database
46+ tools : https://github.com/github/codeql-action/releases/download/${{env.BUNDLE_VERSION}}/codeql-bundle-linux64.tar.gz
47+ debug : true
4848
49- - name : Run CDS extractor
50- shell : bash
51- run : |
52- export CODEQL_DIST="$(dirname "${{ steps.initialize-codeql.outputs.codeql-path }}")"
53- export CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE="${{ runner.temp }}/codeql-database/javascript"
54- ${{ github.workspace }}/scripts/compile-cds.sh
49+ - name : Run CDS extractor
50+ shell : bash
51+ run : |
52+ export CODEQL_DIST="$(dirname "${{ steps.initialize-codeql.outputs.codeql-path }}")"
53+ export CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE="${{ runner.temp }}/codeql-database/javascript"
54+ ${{ github.workspace }}/scripts/compile-cds.sh
5555
56- - name : Perform CodeQL Analysis
57- id : analyze
58- uses : github/codeql-action/analyze@v4
59- env :
60- LGTM_INDEX_XML_MODE : all
61- LGTM_INDEX_FILETYPES : " .json:JSON"
56+ - name : Perform CodeQL Analysis
57+ id : analyze
58+ uses : github/codeql-action/analyze@v4
59+ env :
60+ LGTM_INDEX_XML_MODE : all
61+ LGTM_INDEX_FILETYPES : " .json:JSON"
6262
63- - name : Setup Python
64- uses : actions/setup-python@v5
65- with :
66- python-version : ' 3.10'
63+ - name : Setup Python
64+ uses : actions/setup-python@v5
65+ with :
66+ python-version : " 3.10"
6767
68- - uses : actions/cache@v4
69- with :
70- path : ~/.cache/pip
71- key : ${{ runner.os }}-pip
68+ - uses : actions/cache@v4
69+ with :
70+ path : ~/.cache/pip
71+ key : ${{ runner.os }}-pip
7272
73- - name : Validate results
74- continue-on-error : true
75- id : validate
76- run : |
77- pip install sarif-tools
78- sarif --version
79- sarif diff ${{ steps.analyze.outputs.sarif-output }} .github/workflows/javascript.sarif.expected -o sarif-diff.json
80- cat sarif-diff.json
81- ! grep -q "[1-9]" sarif-diff.json
73+ - name : Validate results
74+ continue-on-error : true
75+ id : validate
76+ run : |
77+ pip install sarif-tools
78+ sarif --version
79+ sarif diff ${{ steps.analyze.outputs.sarif-output }} .github/workflows/javascript.sarif.expected -o sarif-diff.json
80+ cat sarif-diff.json
81+ ! grep -q "[1-9]" sarif-diff.json
8282
83- - name : Upload sarif change
84- if : steps.validate.outcome != 'success'
85- uses : actions/upload-artifact@v6
86- with :
87- name : sarif
88- path : |
89- sarif-diff.json
90- ${{ steps.analyze.outputs.sarif-output }}
83+ - name : Upload sarif change
84+ if : steps.validate.outcome != 'success'
85+ uses : actions/upload-artifact@v6
86+ with :
87+ name : sarif
88+ path : |
89+ sarif-diff.json
90+ ${{ steps.analyze.outputs.sarif-output }}
9191
92- - name : Unexpected Code Scanning results
93- if : steps.validate.outcome != 'success'
94- run : |
95- cat sarif-diff.json
96- echo "::error::Unexpected Code Scanning results!" && exit 1
92+ - name : Unexpected Code Scanning results
93+ if : steps.validate.outcome != 'success'
94+ run : |
95+ cat sarif-diff.json
96+ echo "::error::Unexpected Code Scanning results!" && exit 1
0 commit comments