File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,9 @@ export async function jsonValidator(exclude) {
149
149
. withPromise ( )
150
150
}
151
151
152
+ // Create a Set to track processed files
153
+ const processedFiles = new Set ( )
154
+
152
155
for ( const fullPath of files ) {
153
156
core . debug ( `found file: ${ fullPath } ` )
154
157
@@ -188,6 +191,12 @@ export async function jsonValidator(exclude) {
188
191
continue
189
192
}
190
193
194
+ // Check if the file has already been processed
195
+ if ( processedFiles . has ( fullPath ) ) {
196
+ core . debug ( `skipping duplicate file: ${ fullPath } ` )
197
+ continue
198
+ }
199
+
191
200
var data
192
201
try {
193
202
// if the file is a yaml file but being treated as json and yamlAsJson is true
@@ -250,6 +259,9 @@ export async function jsonValidator(exclude) {
250
259
continue
251
260
}
252
261
262
+ // Add the file to the processedFiles Set
263
+ processedFiles . add ( fullPath )
264
+
253
265
result . passed ++
254
266
core . info ( `${ fullPath } is valid` )
255
267
}
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ export async function yamlValidator(exclude) {
62
62
. withPromise ( )
63
63
}
64
64
65
+ // Create a Set to track processed files
66
+ const processedFiles = new Set ( )
67
+
65
68
for ( const fullPath of files ) {
66
69
core . debug ( `found file: ${ fullPath } ` )
67
70
@@ -93,6 +96,12 @@ export async function yamlValidator(exclude) {
93
96
continue
94
97
}
95
98
99
+ // Check if the file has already been processed
100
+ if ( processedFiles . has ( fullPath ) ) {
101
+ core . debug ( `skipping duplicate file: ${ fullPath } ` )
102
+ continue
103
+ }
104
+
96
105
let multipleDocuments = false
97
106
98
107
try {
@@ -176,6 +185,9 @@ export async function yamlValidator(exclude) {
176
185
continue
177
186
}
178
187
188
+ // Add the file to the processedFiles Set
189
+ processedFiles . add ( fullPath )
190
+
179
191
result . passed ++
180
192
core . info ( `${ fullPath } is valid` )
181
193
}
You can’t perform that action at this time.
0 commit comments