Skip to content

Commit a5cf6aa

Browse files
feat: add support for returning true for any_{changed, modified, deleted} outputs when no patterns are specified (#1988)
Co-authored-by: GitHub Action <action@github.com>
1 parent 15807c9 commit a5cf6aa

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ outputs:
270270
all_changed_files_count:
271271
description: "Returns the number of `all_changed_files`"
272272
any_changed:
273-
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
273+
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have changed. This defaults to `true` when no patterns are specified. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
274274
only_changed:
275275
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
276276
other_changed_files:
@@ -282,17 +282,17 @@ outputs:
282282
all_modified_files_count:
283283
description: "Returns the number of `all_modified_files`"
284284
any_modified:
285-
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
285+
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been modified. This defaults to `true` when no patterns are specified. i.e. *includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
286286
only_modified:
287-
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)."
287+
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been modified. (ACMRD)."
288288
other_modified_files:
289289
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
290290
other_modified_files_count:
291291
description: "Returns the number of `other_modified_files`"
292292
any_deleted:
293-
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
293+
description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been deleted. This defaults to `true` when no patterns are specified. (D)"
294294
only_deleted:
295-
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)"
295+
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been deleted. (D)"
296296
other_deleted_files:
297297
description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
298298
other_deleted_files_count:

dist/index.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/changedFilesOutput.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
247247

248248
await setOutput({
249249
key: getOutputKey('any_changed', outputPrefix),
250-
value: allChangedFiles.paths.length > 0 && filePatterns.length > 0,
250+
value: allChangedFiles.paths.length > 0,
251251
writeOutputFiles: inputs.writeOutputFiles,
252252
outputDir: inputs.outputDir,
253253
json: inputs.json
@@ -336,7 +336,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
336336

337337
await setOutput({
338338
key: getOutputKey('any_modified', outputPrefix),
339-
value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
339+
value: allModifiedFiles.paths.length > 0,
340340
writeOutputFiles: inputs.writeOutputFiles,
341341
outputDir: inputs.outputDir,
342342
json: inputs.json
@@ -442,7 +442,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
442442

443443
await setOutput({
444444
key: getOutputKey('any_deleted', outputPrefix),
445-
value: deletedFiles.paths.length > 0 && filePatterns.length > 0,
445+
value: deletedFiles.paths.length > 0,
446446
writeOutputFiles: inputs.writeOutputFiles,
447447
outputDir: inputs.outputDir,
448448
json: inputs.json
@@ -496,7 +496,7 @@ export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
496496
})
497497

498498
return {
499-
anyModified: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
500-
anyChanged: allChangedFiles.paths.length > 0 && filePatterns.length > 0
499+
anyModified: allModifiedFiles.paths.length > 0,
500+
anyChanged: allChangedFiles.paths.length > 0
501501
}
502502
}

0 commit comments

Comments
 (0)