@@ -60,6 +60,7 @@ Verify that certain files or directories did or did not change during the workfl
60
60
uses : tj-actions/verify-changed-files@v16
61
61
id : verify-changed-files
62
62
with :
63
+ safe_output : false # true by default, set to false because we are using an environment variable to store the output and avoid command injection.
63
64
files : |
64
65
*.txt
65
66
test_directory
@@ -69,8 +70,11 @@ Verify that certain files or directories did or did not change during the workfl
69
70
70
71
- name : Run step only when any of the above files change.
71
72
if : steps.verify-changed-files.outputs.files_changed == 'true'
73
+ env :
74
+ FILES_CHANGED : |-
75
+ ${{ steps.verify-changed-files.outputs.changed_files }}
72
76
run : |
73
- echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }} "
77
+ echo "Changed files: $FILES_CHANGED "
74
78
# Outputs: "Changed files: new.txt test_directory/new.txt"
75
79
```
76
80
@@ -82,6 +86,7 @@ Verify that certain files or directories did or did not change during the workfl
82
86
uses : tj-actions/verify-changed-files@v16
83
87
id : verify-changed-files
84
88
with :
89
+ safe_output : false
85
90
files : |
86
91
new.txt
87
92
test_directory
@@ -99,10 +104,15 @@ Verify that certain files or directories did or did not change during the workfl
99
104
- name : Verify Changed files
100
105
uses : tj-actions/verify-changed-files@v16
101
106
id : verify-changed-files
107
+ with :
108
+ safe_output : false
102
109
103
110
- name : List all changed files tracked and untracked files
111
+ env :
112
+ FILES_CHANGED : |-
113
+ ${{ steps.verify-changed-files.outputs.changed_files }}
104
114
run : |
105
- echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }} "
115
+ echo "Changed files: $FILES_CHANGED "
106
116
` ` `
107
117
108
118
If you feel generous and want to show some extra appreciation:
0 commit comments