Skip to content

Commit e582790

Browse files
authored
Merge pull request #18 from gitcoindev/feat-limit-api-requests-core-contracts-check-and-graphql-only-on-push-to-development-branch
Feat limit api requests core contracts check and graphql only on push to development branch
2 parents 5a8cbb3 + 1129657 commit e582790

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/codeql-analysis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: CodeQL Analysis
33
on:
44
pull_request:
55
push:
6+
branches:
7+
- development
68

79
jobs:
810
code-ql-analysis:

.github/workflows/core-contracts-storage-check.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,24 @@ jobs:
2020
with:
2121
version: nightly
2222

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
2433
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 }}
2537
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
2741
echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
2842
2943
outputs:

0 commit comments

Comments
 (0)