File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: CodeQL Analysis
3
3
on :
4
4
pull_request :
5
5
push :
6
+ branches :
7
+ - development
6
8
7
9
jobs :
8
10
code-ql-analysis :
Original file line number Diff line number Diff line change @@ -20,10 +20,24 @@ jobs:
20
20
with :
21
21
version : nightly
22
22
23
- - id : set-matrix
23
+ - name : Narrow down test matrix scope to changed contracts to limit API requests
24
+ id : changed-contracts
25
+ uses : tj-actions/changed-files@v42
26
+ with :
27
+ files_yaml : |
28
+ contracts:
29
+ - packages/contracts/src/dollar/core/*.sol
30
+
31
+ - name : Set contracts matrix
32
+ id : set-matrix
24
33
working-directory : packages/contracts
34
+ if : steps.changed-contracts.outputs.contracts_any_changed == 'true'
35
+ env :
36
+ CHANGED_CONTRACTS : ${{ steps.changed-contracts.outputs.contracts_all_changed_files }}
25
37
run : |
26
- forge tree | grep -E '^src/dollar/core' | cut -d' ' -f1 | xargs basename -s | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt
38
+ for CONTRACT in "$CHANGED_CONTRACTS"; do
39
+ echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt
40
+ done
27
41
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
28
42
29
43
outputs :
You can’t perform that action at this time.
0 commit comments