Commit 7fa3400 1 parent b6216ea commit 7fa3400 Copy full SHA for 7fa3400
File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,24 @@ jobs:
28
28
with :
29
29
egress-policy : audit
30
30
- uses : actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
31
- - name : Set matrix data
31
+ with :
32
+ fetch-depth : 2
33
+ - name : Set Matrix data
32
34
id : set-matrix
33
- run : echo "matrix=$(jq -c . < .github/dockerhub-readmes.json)" >> $GITHUB_OUTPUT
35
+ run : |
36
+ # Get the list of files changed in the latest commit(s)
37
+ changed_files=$(git diff --name-only HEAD~1 ${{ github.sha }} | sed 's|^|./|' | jq -R . | jq -s .)
38
+ echo "Changed files: $changed_files"
39
+
40
+ # If there are changed files, filter the JSON using jq
41
+ matrix=$(jq -c --argjson changed "$changed_files" \
42
+ '.readmes |= map(select(.fname as $fname | any($changed[]; . == $fname)))' \
43
+ .github/dockerhub-readmes.json)
44
+ echo "matrix=$matrix" >> $GITHUB_OUTPUT
34
45
publish-dockerhub-description :
35
46
runs-on : ${{ github.repository_owner == 'intel' && 'intel-ubuntu-latest' || 'ubuntu-latest' }}
36
47
needs : setup-matrix
48
+ if : ${{ needs.setup-matrix.outputs.matrix != '{"readmes":[]}' }}
37
49
strategy :
38
50
matrix : ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
39
51
fail-fast : false
You can’t perform that action at this time.
0 commit comments