Commit a58f829 1 parent 6cf56b4 commit a58f829 Copy full SHA for a58f829
File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,21 @@ jobs:
34
34
- name : Get list of changed Dockerfiles
35
35
id : get_changed_files
36
36
run : |
37
- changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep ansible/docker/test/Dockerfile)
38
- echo "changed_files=$changed_files" >> "$GITHUB_OUTPUT"
37
+ if [ ${{ github.event_name }} == "push" ]; then
38
+ changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep ansible/docker/test/Dockerfile)
39
+ else
40
+ changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep ansible/docker/test/Dockerfile)
41
+ fi
42
+ echo "changed_files=$changed_files" >> "$GITHUB_ENV"
39
43
40
44
# Generate matrix
41
45
- name : Generate matrix
42
46
id : generate_matrix
43
47
run : |
44
- matrix=$(jq -n --arg files "$changed_files" '{
45
- include: ($files | split("\n") | map(select(length > 0) | {dockerfile: .}))
48
+ matrix=$(jq -n --arg files "${ changed_files} " '{
49
+ " include" : ($files | split("\n") | map(select(length > 0) | {dockerfile: .}))
46
50
}')
47
- echo "matrix=$ matrix" >> " $GITHUB_OUTPUT"
51
+ echo "matrix<<EOF"$'\n'"$ matrix"$'\n'EOF >> $GITHUB_OUTPUT
48
52
49
53
build-dockerfiles :
50
54
name : Build Dockerfiles
You can’t perform that action at this time.
0 commit comments