File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed
Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -10,31 +10,24 @@ concurrency:
1010 cancel-in-progress : true
1111
1212jobs :
13- # 2. DISCOVERY: Find exactly what changed and output JSON
1413 discover :
1514 runs-on : ubuntu-latest
1615 outputs :
17- packages : ${{ steps.set-matrix .outputs.packages }}
16+ packages : ${{ steps.changes .outputs.all_changed_files }}
1817 steps :
1918 - uses : actions/checkout@v4
2019 with :
21- fetch-depth : 0 # Needed to diff against main
22-
23- - name : Calculate Changed Packages
24- id : set-matrix
25- run : |
26- # Find all modified directories inside packages/
27- CHANGED=$(git diff --name-only origin/main...HEAD | grep "^packages/" | cut -d/ -f2 | sort -u || true)
20+ fetch-depth : 0
2821
29- if [ -z "$CHANGED" ]; then
30- echo "packages=[]" >> $GITHUB_OUTPUT
31- exit 0
32- fi
33-
34- # Convert bash list to JSON array using jq
35- JSON_ARRAY=$(jq -R -s -c 'split("\n")[:-1]' <<< "$CHANGED")
36- echo "Discovered packages: $JSON_ARRAY"
37- echo "packages=$JSON_ARRAY" >> $GITHUB_OUTPUT
22+ - name : Detect Changed Packages
23+ id : changes
24+ uses : tj-actions/changed-files@v44
25+ with :
26+ files : packages/** # Only watch the packages directory
27+ dir_names : true # Return folder names, not files
28+ dir_names_max_depth : 2 # Strip it down to just "google-cloud-storage"
29+ json : true # Output a perfect JSON array for the matrix
30+ escape_json : false
3831
3932 # 3. EXECUTION: Native Fan-out Matrix
4033 unit-test :
You can’t perform that action at this time.
0 commit comments