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