1919 steps :
2020 - name : " Checkout"
2121 uses : actions/checkout@v5
22+ with :
23+ submodules : true
2224
2325 - name : " Check for changes"
2426 uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@@ -67,24 +69,82 @@ jobs:
6769 run : |
6870 ./scripts/run-tests.sh "ql/test/${{ matrix.test-folders }}"
6971
70- docs :
72+ scanning :
7173 runs-on : ubuntu-latest
74+ needs : [tests]
75+
76+ strategy :
77+ matrix :
78+ project : ["hashicorp/terraform-guides", "akamai/terraform-examples", "aws-samples/aws-sam-terraform-examples"]
79+
7280 steps :
73- - uses : actions/checkout@v5
74- - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
75- id : changes
81+ - name : " Checkout"
82+ uses : actions/checkout@v5
83+ with :
84+ submodules : true
85+
86+ - name : " Checkout"
87+ uses : actions/checkout@v5
88+ with :
89+ repository : ${{ matrix.project }}
90+ path : project
91+
92+ - name : " Check for changes"
93+ uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
94+ id : extractor-changes
7695 with :
7796 filters : |
7897 src:
79- - '**.md'
80- # lint markdown
81- - name : " Lint Markdown"
82- if : steps.changes.outputs.src == 'true'
98+ - 'extractor/**'
99+ - 'rust-toolchain.toml'
100+ - 'Cargo.*'
101+
102+ - name : " Download Extracter"
103+ if : steps.extractor-changes.outputs.src == 'false'
104+ env :
105+ GH_TOKEN : ${{ github.token }}
83106 run : |
84- npm install -g markdownlint-cli
85- markdownlint '**.md' --ignore node_modules --disable MD013
107+ set -e
108+ gh release list -L 1 -R "advanced-security/codeql-extractor-iac"
109+
110+ gh release download \
111+ -R "advanced-security/codeql-extractor-iac" \
112+ --clobber \
113+ --pattern 'extractor-iac.tar.gz'
114+
115+ tar -zxf extractor-iac.tar.gz
116+
117+ - uses : dtolnay/rust-toolchain@4305c38b25d97ef35a8ad1f985ccf2d2242004f2 # stable
118+ if : steps.extractor-changes.outputs.src == 'true'
119+
120+ - name : " Build Extractor"
121+ if : steps.extractor-changes.outputs.src == 'true'
122+ env :
123+ GH_TOKEN : ${{ github.token }}
124+ run : |
125+ set -e
126+ gh extensions install github/gh-codeql
127+ gh codeql set-version latest
128+
129+ ./scripts/create-extractor-pack.sh
130+
131+ gh codeql resolve languages --format=json --search-path ./extractor-pack
86132
87- action :
133+ - name : " Run CodeQL Analysis"
134+ env :
135+ GH_TOKEN : ${{ github.token }}
136+ PROJECT_REPO : ${{ matrix.project }}
137+ run : |
138+ set -e
139+ gh extensions install github/gh-codeql
140+ gh codeql set-version latest
141+
142+ gh codeql database create iac-db --language=iac --source-root=./project --search-path ./extractor-pack
143+
144+ gh codeql database analyze iac-db "advanced-security/iac-queries" --format=sarifv2.1.0 --output="iac-${PROJECT_REPO}.sarif"
145+
146+
147+ docs :
88148 runs-on : ubuntu-latest
89149 steps :
90150 - uses : actions/checkout@v5
@@ -93,11 +153,10 @@ jobs:
93153 with :
94154 filters : |
95155 src:
96- - '.github/action/**'
97- - 'action.yml'
98-
99- - name : Run action
156+ - '**.md'
157+ # lint markdown
158+ - name : " Lint Markdown"
100159 if : steps.changes.outputs.src == 'true'
101- uses : ./
102- with :
103- extractor-version : latest
160+ run : |
161+ npm install -g markdownlint-cli
162+ markdownlint '**.md' --ignore node_modules --disable MD013
0 commit comments