feat: add support for returning changed file counts (#1273)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
		
							parent
							
								
									c3c3db7fee
								
							
						
					
					
						commit
						f573054697
					
				
							
								
								
									
										30
									
								
								action.yml
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								action.yml
									
									
									
									
									
								
							| @ -157,46 +157,76 @@ inputs: | |||||||
| outputs: | outputs: | ||||||
|   added_files: |   added_files: | ||||||
|     description: "Returns only files that are Added (A)." |     description: "Returns only files that are Added (A)." | ||||||
|  |   added_files_count: | ||||||
|  |     description: "Returns the number of `added_files`" | ||||||
|   copied_files: |   copied_files: | ||||||
|     description: "Returns only files that are Copied (C)." |     description: "Returns only files that are Copied (C)." | ||||||
|  |   copied_files_count: | ||||||
|  |     description: "Returns the number of `copied_files`" | ||||||
|   deleted_files: |   deleted_files: | ||||||
|     description: "Returns only files that are Deleted (D)." |     description: "Returns only files that are Deleted (D)." | ||||||
|  |   deleted_files_count: | ||||||
|  |     description: "Returns the number of `deleted_files`" | ||||||
|   modified_files: |   modified_files: | ||||||
|     description: "Returns only files that are Modified (M)." |     description: "Returns only files that are Modified (M)." | ||||||
|  |   modified_files_count: | ||||||
|  |     description: "Returns the number of `modified_files`" | ||||||
|   renamed_files: |   renamed_files: | ||||||
|     description: "Returns only files that are Renamed (R)." |     description: "Returns only files that are Renamed (R)." | ||||||
|  |   renamed_files_count: | ||||||
|  |     description: "Returns the number of `renamed_files`" | ||||||
|   all_old_new_renamed_files: |   all_old_new_renamed_files: | ||||||
|     description:   "Returns only files that are Renamed and lists their old and new names. **NOTE:** This requires setting `include_all_old_new_renamed_files` to `true`. Also, keep in mind that this output is global and wouldn't be nested in outputs generated when the `*_yaml_*` input is used. (R)" |     description:   "Returns only files that are Renamed and lists their old and new names. **NOTE:** This requires setting `include_all_old_new_renamed_files` to `true`. Also, keep in mind that this output is global and wouldn't be nested in outputs generated when the `*_yaml_*` input is used. (R)" | ||||||
|  |   all_old_new_renamed_files_count: | ||||||
|  |     description:   "Returns the number of `all_old_new_renamed_files`" | ||||||
|   type_changed_files: |   type_changed_files: | ||||||
|     description: "Returns only files that have their file type changed (T)." |     description: "Returns only files that have their file type changed (T)." | ||||||
|  |   type_changed_files_count: | ||||||
|  |     description: "Returns the number of `type_changed_files`" | ||||||
|   unmerged_files: |   unmerged_files: | ||||||
|     description: "Returns only files that are Unmerged (U)." |     description: "Returns only files that are Unmerged (U)." | ||||||
|  |   unmerged_files_count: | ||||||
|  |     description: "Returns the number of `unmerged_files`" | ||||||
|   unknown_files: |   unknown_files: | ||||||
|     description: "Returns only files that are Unknown (X)." |     description: "Returns only files that are Unknown (X)." | ||||||
|  |   unknown_files_count: | ||||||
|  |     description: "Returns the number of `unknown_files`" | ||||||
|   all_changed_and_modified_files: |   all_changed_and_modified_files: | ||||||
|     description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*" |     description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*" | ||||||
|  |   all_changed_and_modified_files_count: | ||||||
|  |     description: "Returns the number of `all_changed_and_modified_files`" | ||||||
|   all_changed_files: |   all_changed_files: | ||||||
|     description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*" |     description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*" | ||||||
|  |   all_changed_files_count: | ||||||
|  |     description: "Returns the number of `all_changed_files`" | ||||||
|   any_changed: |   any_changed: | ||||||
|     description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." |     description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." | ||||||
|   only_changed: |   only_changed: | ||||||
|     description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." |     description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has changed. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." | ||||||
|   other_changed_files: |   other_changed_files: | ||||||
|     description: "Returns all other changed files not listed in the files input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." |     description: "Returns all other changed files not listed in the files input i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*." | ||||||
|  |   other_changed_files_count: | ||||||
|  |     description: "Returns the number of `other_changed_files`" | ||||||
|   all_modified_files: |   all_modified_files: | ||||||
|     description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*." |     description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*." | ||||||
|  |   all_modified_files_count: | ||||||
|  |     description: "Returns the number of `all_modified_files`" | ||||||
|   any_modified: |   any_modified: | ||||||
|     description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*." |     description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been modified. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*." | ||||||
|   only_modified: |   only_modified: | ||||||
|     description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)." |     description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been modified. (ACMRD)." | ||||||
|   other_modified_files: |   other_modified_files: | ||||||
|     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)*" |     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)*" | ||||||
|  |   other_modified_files_count: | ||||||
|  |     description: "Returns the number of `other_modified_files`" | ||||||
|   any_deleted: |   any_deleted: | ||||||
|     description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" |     description: "Returns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" | ||||||
|   only_deleted: |   only_deleted: | ||||||
|     description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" |     description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs has been deleted. (D)" | ||||||
|   other_deleted_files: |   other_deleted_files: | ||||||
|     description: "Returns all other deleted files not listed in the files input i.e. *a  combination of all deleted files (D)*" |     description: "Returns all other deleted files not listed in the files input i.e. *a  combination of all deleted files (D)*" | ||||||
|  |   other_deleted_files_count: | ||||||
|  |     description: "Returns the number of `other_deleted_files`" | ||||||
| 
 | 
 | ||||||
| runs: | runs: | ||||||
|   using: 'node16' |   using: 'node16' | ||||||
|  | |||||||
							
								
								
									
										153
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										153
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -79,9 +79,15 @@ const getRenamedFiles = ({ inputs, workingDirectory, hasSubmodule, diffResult, s | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (inputs.json) { |     if (inputs.json) { | ||||||
|         return (0, utils_1.jsonOutput)({ value: renamedFiles, shouldEscape: inputs.escapeJson }); |         return { | ||||||
|  |             paths: (0, utils_1.jsonOutput)({ value: renamedFiles, shouldEscape: inputs.escapeJson }), | ||||||
|  |             count: renamedFiles.length.toString() | ||||||
|  |         }; | ||||||
|     } |     } | ||||||
|     return renamedFiles.join(inputs.oldNewFilesSeparator); |     return { | ||||||
|  |         paths: renamedFiles.join(inputs.oldNewFilesSeparator), | ||||||
|  |         count: renamedFiles.length.toString() | ||||||
|  |     }; | ||||||
| }); | }); | ||||||
| exports.getRenamedFiles = getRenamedFiles; | exports.getRenamedFiles = getRenamedFiles; | ||||||
| var ChangeTypeEnum; | var ChangeTypeEnum; | ||||||
| @ -157,9 +163,15 @@ const getChangeTypeFiles = ({ inputs, changedFiles, changeTypes }) => __awaiter( | |||||||
|         ...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes })) |         ...new Set(getChangeTypeFilesGenerator({ inputs, changedFiles, changeTypes })) | ||||||
|     ]; |     ]; | ||||||
|     if (inputs.json) { |     if (inputs.json) { | ||||||
|         return (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }); |         return { | ||||||
|  |             paths: (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }), | ||||||
|  |             count: files.length.toString() | ||||||
|  |         }; | ||||||
|     } |     } | ||||||
|     return files.join(inputs.separator); |     return { | ||||||
|  |         paths: files.join(inputs.separator), | ||||||
|  |         count: files.length.toString() | ||||||
|  |     }; | ||||||
| }); | }); | ||||||
| exports.getChangeTypeFiles = getChangeTypeFiles; | exports.getChangeTypeFiles = getChangeTypeFiles; | ||||||
| function* getAllChangeTypeFilesGenerator({ inputs, changedFiles }) { | function* getAllChangeTypeFilesGenerator({ inputs, changedFiles }) { | ||||||
| @ -181,9 +193,15 @@ const getAllChangeTypeFiles = ({ inputs, changedFiles }) => __awaiter(void 0, vo | |||||||
|         ...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles })) |         ...new Set(getAllChangeTypeFilesGenerator({ inputs, changedFiles })) | ||||||
|     ]; |     ]; | ||||||
|     if (inputs.json) { |     if (inputs.json) { | ||||||
|         return (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }); |         return { | ||||||
|  |             paths: (0, utils_1.jsonOutput)({ value: files, shouldEscape: inputs.escapeJson }), | ||||||
|  |             count: files.length.toString() | ||||||
|  |         }; | ||||||
|     } |     } | ||||||
|     return files.join(inputs.separator); |     return { | ||||||
|  |         paths: files.join(inputs.separator), | ||||||
|  |         count: files.length.toString() | ||||||
|  |     }; | ||||||
| }); | }); | ||||||
| exports.getAllChangeTypeFiles = getAllChangeTypeFiles; | exports.getAllChangeTypeFiles = getAllChangeTypeFiles; | ||||||
| 
 | 
 | ||||||
| @ -255,7 +273,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Added files: ${addedFiles}`); |     core.debug(`Added files: ${addedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('added_files', outputPrefix), |         key: getOutputKey('added_files', outputPrefix), | ||||||
|         value: addedFiles, |         value: addedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('added_files_count', outputPrefix), | ||||||
|  |         value: addedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const copiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const copiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -266,7 +289,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Copied files: ${copiedFiles}`); |     core.debug(`Copied files: ${copiedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('copied_files', outputPrefix), |         key: getOutputKey('copied_files', outputPrefix), | ||||||
|         value: copiedFiles, |         value: copiedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('copied_files_count', outputPrefix), | ||||||
|  |         value: copiedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const modifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const modifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -277,7 +305,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Modified files: ${modifiedFiles}`); |     core.debug(`Modified files: ${modifiedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('modified_files', outputPrefix), |         key: getOutputKey('modified_files', outputPrefix), | ||||||
|         value: modifiedFiles, |         value: modifiedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('modified_files_count', outputPrefix), | ||||||
|  |         value: modifiedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const renamedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const renamedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -288,7 +321,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Renamed files: ${renamedFiles}`); |     core.debug(`Renamed files: ${renamedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('renamed_files', outputPrefix), |         key: getOutputKey('renamed_files', outputPrefix), | ||||||
|         value: renamedFiles, |         value: renamedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('renamed_files_count', outputPrefix), | ||||||
|  |         value: renamedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const typeChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const typeChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -299,7 +337,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Type changed files: ${typeChangedFiles}`); |     core.debug(`Type changed files: ${typeChangedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('type_changed_files', outputPrefix), |         key: getOutputKey('type_changed_files', outputPrefix), | ||||||
|         value: typeChangedFiles, |         value: typeChangedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('type_changed_files_count', outputPrefix), | ||||||
|  |         value: typeChangedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const unmergedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const unmergedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -310,7 +353,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Unmerged files: ${unmergedFiles}`); |     core.debug(`Unmerged files: ${unmergedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('unmerged_files', outputPrefix), |         key: getOutputKey('unmerged_files', outputPrefix), | ||||||
|         value: unmergedFiles, |         value: unmergedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('unmerged_files_count', outputPrefix), | ||||||
|  |         value: unmergedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const unknownFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const unknownFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -321,7 +369,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Unknown files: ${unknownFiles}`); |     core.debug(`Unknown files: ${unknownFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('unknown_files', outputPrefix), |         key: getOutputKey('unknown_files', outputPrefix), | ||||||
|         value: unknownFiles, |         value: unknownFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('unknown_files_count', outputPrefix), | ||||||
|  |         value: unknownFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const allChangedAndModifiedFiles = yield (0, changedFiles_1.getAllChangeTypeFiles)({ |     const allChangedAndModifiedFiles = yield (0, changedFiles_1.getAllChangeTypeFiles)({ | ||||||
| @ -331,7 +384,12 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`); |     core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('all_changed_and_modified_files', outputPrefix), |         key: getOutputKey('all_changed_and_modified_files', outputPrefix), | ||||||
|         value: allChangedAndModifiedFiles, |         value: allChangedAndModifiedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('all_changed_and_modified_files_count', outputPrefix), | ||||||
|  |         value: allChangedAndModifiedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const allChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const allChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -347,12 +405,17 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`All changed files: ${allChangedFiles}`); |     core.debug(`All changed files: ${allChangedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('all_changed_files', outputPrefix), |         key: getOutputKey('all_changed_files', outputPrefix), | ||||||
|         value: allChangedFiles, |         value: allChangedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('all_changed_files_count', outputPrefix), | ||||||
|  |         value: allChangedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('any_changed', outputPrefix), |         key: getOutputKey('any_changed', outputPrefix), | ||||||
|         value: allChangedFiles.length > 0 && filePatterns.length > 0, |         value: allChangedFiles.paths.length > 0 && filePatterns.length > 0, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const allOtherChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const allOtherChangedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -366,11 +429,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|         ] |         ] | ||||||
|     }); |     }); | ||||||
|     core.debug(`All other changed files: ${allOtherChangedFiles}`); |     core.debug(`All other changed files: ${allOtherChangedFiles}`); | ||||||
|     const otherChangedFiles = allOtherChangedFiles |     const otherChangedFiles = allOtherChangedFiles.paths | ||||||
|         .split(inputs.separator) |         .split(inputs.separator) | ||||||
|         .filter((filePath) => !allChangedFiles.split(inputs.separator).includes(filePath)); |         .filter((filePath) => !allChangedFiles.paths.split(inputs.separator).includes(filePath)); | ||||||
|     const onlyChanged = otherChangedFiles.length === 0 && |     const onlyChanged = otherChangedFiles.length === 0 && | ||||||
|         allChangedFiles.length > 0 && |         allChangedFiles.paths.length > 0 && | ||||||
|         filePatterns.length > 0; |         filePatterns.length > 0; | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('only_changed', outputPrefix), |         key: getOutputKey('only_changed', outputPrefix), | ||||||
| @ -382,6 +445,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|         value: otherChangedFiles.join(inputs.separator), |         value: otherChangedFiles.join(inputs.separator), | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('other_changed_files_count', outputPrefix), | ||||||
|  |         value: otherChangedFiles.length.toString(), | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|     const allModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const allModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
|         inputs, |         inputs, | ||||||
|         changedFiles: allFilteredDiffFiles, |         changedFiles: allFilteredDiffFiles, | ||||||
| @ -396,12 +464,17 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`All modified files: ${allModifiedFiles}`); |     core.debug(`All modified files: ${allModifiedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('all_modified_files', outputPrefix), |         key: getOutputKey('all_modified_files', outputPrefix), | ||||||
|         value: allModifiedFiles, |         value: allModifiedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('all_modified_files_count', outputPrefix), | ||||||
|  |         value: allModifiedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('any_modified', outputPrefix), |         key: getOutputKey('any_modified', outputPrefix), | ||||||
|         value: allModifiedFiles.length > 0 && filePatterns.length > 0, |         value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const allOtherModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const allOtherModifiedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -415,11 +488,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|             changedFiles_1.ChangeTypeEnum.Deleted |             changedFiles_1.ChangeTypeEnum.Deleted | ||||||
|         ] |         ] | ||||||
|     }); |     }); | ||||||
|     const otherModifiedFiles = allOtherModifiedFiles |     const otherModifiedFiles = allOtherModifiedFiles.paths | ||||||
|         .split(inputs.separator) |         .split(inputs.separator) | ||||||
|         .filter((filePath) => !allModifiedFiles.split(inputs.separator).includes(filePath)); |         .filter((filePath) => !allModifiedFiles.paths.split(inputs.separator).includes(filePath)); | ||||||
|     const onlyModified = otherModifiedFiles.length === 0 && |     const onlyModified = otherModifiedFiles.length === 0 && | ||||||
|         allModifiedFiles.length > 0 && |         allModifiedFiles.paths.length > 0 && | ||||||
|         filePatterns.length > 0; |         filePatterns.length > 0; | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('only_modified', outputPrefix), |         key: getOutputKey('only_modified', outputPrefix), | ||||||
| @ -431,6 +504,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|         value: otherModifiedFiles.join(inputs.separator), |         value: otherModifiedFiles.join(inputs.separator), | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('other_modified_files_count', outputPrefix), | ||||||
|  |         value: otherModifiedFiles.length.toString(), | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|     const deletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const deletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
|         inputs, |         inputs, | ||||||
|         changedFiles: allFilteredDiffFiles, |         changedFiles: allFilteredDiffFiles, | ||||||
| @ -439,12 +517,17 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|     core.debug(`Deleted files: ${deletedFiles}`); |     core.debug(`Deleted files: ${deletedFiles}`); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('deleted_files', outputPrefix), |         key: getOutputKey('deleted_files', outputPrefix), | ||||||
|         value: deletedFiles, |         value: deletedFiles.paths, | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('deleted_files_count', outputPrefix), | ||||||
|  |         value: deletedFiles.count, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('any_deleted', outputPrefix), |         key: getOutputKey('any_deleted', outputPrefix), | ||||||
|         value: deletedFiles.length > 0 && filePatterns.length > 0, |         value: deletedFiles.paths.length > 0 && filePatterns.length > 0, | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|     const allOtherDeletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ |     const allOtherDeletedFiles = yield (0, changedFiles_1.getChangeTypeFiles)({ | ||||||
| @ -452,11 +535,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|         changedFiles: allDiffFiles, |         changedFiles: allDiffFiles, | ||||||
|         changeTypes: [changedFiles_1.ChangeTypeEnum.Deleted] |         changeTypes: [changedFiles_1.ChangeTypeEnum.Deleted] | ||||||
|     }); |     }); | ||||||
|     const otherDeletedFiles = allOtherDeletedFiles |     const otherDeletedFiles = allOtherDeletedFiles.paths | ||||||
|         .split(inputs.separator) |         .split(inputs.separator) | ||||||
|         .filter(filePath => !deletedFiles.split(inputs.separator).includes(filePath)); |         .filter(filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath)); | ||||||
|     const onlyDeleted = otherDeletedFiles.length === 0 && |     const onlyDeleted = otherDeletedFiles.length === 0 && | ||||||
|         deletedFiles.length > 0 && |         deletedFiles.paths.length > 0 && | ||||||
|         filePatterns.length > 0; |         filePatterns.length > 0; | ||||||
|     yield (0, utils_1.setOutput)({ |     yield (0, utils_1.setOutput)({ | ||||||
|         key: getOutputKey('only_deleted', outputPrefix), |         key: getOutputKey('only_deleted', outputPrefix), | ||||||
| @ -468,6 +551,11 @@ const setChangedFilesOutput = ({ allDiffFiles, inputs, workingDirectory, diffRes | |||||||
|         value: otherDeletedFiles.join(inputs.separator), |         value: otherDeletedFiles.join(inputs.separator), | ||||||
|         inputs |         inputs | ||||||
|     }); |     }); | ||||||
|  |     yield (0, utils_1.setOutput)({ | ||||||
|  |         key: getOutputKey('other_deleted_files_count', outputPrefix), | ||||||
|  |         value: otherDeletedFiles.length.toString(), | ||||||
|  |         inputs | ||||||
|  |     }); | ||||||
| }); | }); | ||||||
| exports.setChangedFilesOutput = setChangedFilesOutput; | exports.setChangedFilesOutput = setChangedFilesOutput; | ||||||
| 
 | 
 | ||||||
| @ -1305,7 +1393,12 @@ function run() { | |||||||
|             core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`); |             core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`); | ||||||
|             yield (0, utils_1.setOutput)({ |             yield (0, utils_1.setOutput)({ | ||||||
|                 key: 'all_old_new_renamed_files', |                 key: 'all_old_new_renamed_files', | ||||||
|                 value: allOldNewRenamedFiles, |                 value: allOldNewRenamedFiles.paths, | ||||||
|  |                 inputs | ||||||
|  |             }); | ||||||
|  |             yield (0, utils_1.setOutput)({ | ||||||
|  |                 key: 'all_old_new_renamed_files_count', | ||||||
|  |                 value: allOldNewRenamedFiles.count, | ||||||
|                 inputs |                 inputs | ||||||
|             }); |             }); | ||||||
|             core.info('All Done!'); |             core.info('All Done!'); | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -23,7 +23,7 @@ export const getRenamedFiles = async ({ | |||||||
|   hasSubmodule: boolean |   hasSubmodule: boolean | ||||||
|   diffResult: DiffResult |   diffResult: DiffResult | ||||||
|   submodulePaths: string[] |   submodulePaths: string[] | ||||||
| }): Promise<string> => { | }): Promise<{paths: string; count: string}> => { | ||||||
|   const renamedFiles = await gitRenamedFiles({ |   const renamedFiles = await gitRenamedFiles({ | ||||||
|     cwd: workingDirectory, |     cwd: workingDirectory, | ||||||
|     sha1: diffResult.previousSha, |     sha1: diffResult.previousSha, | ||||||
| @ -63,10 +63,16 @@ export const getRenamedFiles = async ({ | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (inputs.json) { |   if (inputs.json) { | ||||||
|     return jsonOutput({value: renamedFiles, shouldEscape: inputs.escapeJson}) |     return { | ||||||
|  |       paths: jsonOutput({value: renamedFiles, shouldEscape: inputs.escapeJson}), | ||||||
|  |       count: renamedFiles.length.toString() | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   return renamedFiles.join(inputs.oldNewFilesSeparator) |   return { | ||||||
|  |     paths: renamedFiles.join(inputs.oldNewFilesSeparator), | ||||||
|  |     count: renamedFiles.length.toString() | ||||||
|  |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export enum ChangeTypeEnum { | export enum ChangeTypeEnum { | ||||||
| @ -180,16 +186,22 @@ export const getChangeTypeFiles = async ({ | |||||||
|   inputs: Inputs |   inputs: Inputs | ||||||
|   changedFiles: ChangedFiles |   changedFiles: ChangedFiles | ||||||
|   changeTypes: ChangeTypeEnum[] |   changeTypes: ChangeTypeEnum[] | ||||||
| }): Promise<string> => { | }): Promise<{paths: string; count: string}> => { | ||||||
|   const files = [ |   const files = [ | ||||||
|     ...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes})) |     ...new Set(getChangeTypeFilesGenerator({inputs, changedFiles, changeTypes})) | ||||||
|   ] |   ] | ||||||
| 
 | 
 | ||||||
|   if (inputs.json) { |   if (inputs.json) { | ||||||
|     return jsonOutput({value: files, shouldEscape: inputs.escapeJson}) |     return { | ||||||
|  |       paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}), | ||||||
|  |       count: files.length.toString() | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   return files.join(inputs.separator) |   return { | ||||||
|  |     paths: files.join(inputs.separator), | ||||||
|  |     count: files.length.toString() | ||||||
|  |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function* getAllChangeTypeFilesGenerator({ | function* getAllChangeTypeFilesGenerator({ | ||||||
| @ -219,14 +231,20 @@ export const getAllChangeTypeFiles = async ({ | |||||||
| }: { | }: { | ||||||
|   inputs: Inputs |   inputs: Inputs | ||||||
|   changedFiles: ChangedFiles |   changedFiles: ChangedFiles | ||||||
| }): Promise<string> => { | }): Promise<{paths: string; count: string}> => { | ||||||
|   const files = [ |   const files = [ | ||||||
|     ...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles})) |     ...new Set(getAllChangeTypeFilesGenerator({inputs, changedFiles})) | ||||||
|   ] |   ] | ||||||
| 
 | 
 | ||||||
|   if (inputs.json) { |   if (inputs.json) { | ||||||
|     return jsonOutput({value: files, shouldEscape: inputs.escapeJson}) |     return { | ||||||
|  |       paths: jsonOutput({value: files, shouldEscape: inputs.escapeJson}), | ||||||
|  |       count: files.length.toString() | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   return files.join(inputs.separator) |   return { | ||||||
|  |     paths: files.join(inputs.separator), | ||||||
|  |     count: files.length.toString() | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -49,7 +49,12 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Added files: ${addedFiles}`) |   core.debug(`Added files: ${addedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('added_files', outputPrefix), |     key: getOutputKey('added_files', outputPrefix), | ||||||
|     value: addedFiles, |     value: addedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('added_files_count', outputPrefix), | ||||||
|  |     value: addedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -61,7 +66,13 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Copied files: ${copiedFiles}`) |   core.debug(`Copied files: ${copiedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('copied_files', outputPrefix), |     key: getOutputKey('copied_files', outputPrefix), | ||||||
|     value: copiedFiles, |     value: copiedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('copied_files_count', outputPrefix), | ||||||
|  |     value: copiedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -73,7 +84,13 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Modified files: ${modifiedFiles}`) |   core.debug(`Modified files: ${modifiedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('modified_files', outputPrefix), |     key: getOutputKey('modified_files', outputPrefix), | ||||||
|     value: modifiedFiles, |     value: modifiedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('modified_files_count', outputPrefix), | ||||||
|  |     value: modifiedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -85,7 +102,13 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Renamed files: ${renamedFiles}`) |   core.debug(`Renamed files: ${renamedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('renamed_files', outputPrefix), |     key: getOutputKey('renamed_files', outputPrefix), | ||||||
|     value: renamedFiles, |     value: renamedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('renamed_files_count', outputPrefix), | ||||||
|  |     value: renamedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -97,7 +120,13 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Type changed files: ${typeChangedFiles}`) |   core.debug(`Type changed files: ${typeChangedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('type_changed_files', outputPrefix), |     key: getOutputKey('type_changed_files', outputPrefix), | ||||||
|     value: typeChangedFiles, |     value: typeChangedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('type_changed_files_count', outputPrefix), | ||||||
|  |     value: typeChangedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -109,7 +138,13 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Unmerged files: ${unmergedFiles}`) |   core.debug(`Unmerged files: ${unmergedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('unmerged_files', outputPrefix), |     key: getOutputKey('unmerged_files', outputPrefix), | ||||||
|     value: unmergedFiles, |     value: unmergedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('unmerged_files_count', outputPrefix), | ||||||
|  |     value: unmergedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -121,7 +156,13 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Unknown files: ${unknownFiles}`) |   core.debug(`Unknown files: ${unknownFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('unknown_files', outputPrefix), |     key: getOutputKey('unknown_files', outputPrefix), | ||||||
|     value: unknownFiles, |     value: unknownFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('unknown_files_count', outputPrefix), | ||||||
|  |     value: unknownFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -132,7 +173,13 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`) |   core.debug(`All changed and modified files: ${allChangedAndModifiedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('all_changed_and_modified_files', outputPrefix), |     key: getOutputKey('all_changed_and_modified_files', outputPrefix), | ||||||
|     value: allChangedAndModifiedFiles, |     value: allChangedAndModifiedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('all_changed_and_modified_files_count', outputPrefix), | ||||||
|  |     value: allChangedAndModifiedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -149,13 +196,19 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`All changed files: ${allChangedFiles}`) |   core.debug(`All changed files: ${allChangedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('all_changed_files', outputPrefix), |     key: getOutputKey('all_changed_files', outputPrefix), | ||||||
|     value: allChangedFiles, |     value: allChangedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('all_changed_files_count', outputPrefix), | ||||||
|  |     value: allChangedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('any_changed', outputPrefix), |     key: getOutputKey('any_changed', outputPrefix), | ||||||
|     value: allChangedFiles.length > 0 && filePatterns.length > 0, |     value: allChangedFiles.paths.length > 0 && filePatterns.length > 0, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -171,16 +224,16 @@ export const setChangedFilesOutput = async ({ | |||||||
|   }) |   }) | ||||||
|   core.debug(`All other changed files: ${allOtherChangedFiles}`) |   core.debug(`All other changed files: ${allOtherChangedFiles}`) | ||||||
| 
 | 
 | ||||||
|   const otherChangedFiles = allOtherChangedFiles |   const otherChangedFiles = allOtherChangedFiles.paths | ||||||
|     .split(inputs.separator) |     .split(inputs.separator) | ||||||
|     .filter( |     .filter( | ||||||
|       (filePath: string) => |       (filePath: string) => | ||||||
|         !allChangedFiles.split(inputs.separator).includes(filePath) |         !allChangedFiles.paths.split(inputs.separator).includes(filePath) | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|   const onlyChanged = |   const onlyChanged = | ||||||
|     otherChangedFiles.length === 0 && |     otherChangedFiles.length === 0 && | ||||||
|     allChangedFiles.length > 0 && |     allChangedFiles.paths.length > 0 && | ||||||
|     filePatterns.length > 0 |     filePatterns.length > 0 | ||||||
| 
 | 
 | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
| @ -195,6 +248,12 @@ export const setChangedFilesOutput = async ({ | |||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('other_changed_files_count', outputPrefix), | ||||||
|  |     value: otherChangedFiles.length.toString(), | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|   const allModifiedFiles = await getChangeTypeFiles({ |   const allModifiedFiles = await getChangeTypeFiles({ | ||||||
|     inputs, |     inputs, | ||||||
|     changedFiles: allFilteredDiffFiles, |     changedFiles: allFilteredDiffFiles, | ||||||
| @ -209,13 +268,19 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`All modified files: ${allModifiedFiles}`) |   core.debug(`All modified files: ${allModifiedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('all_modified_files', outputPrefix), |     key: getOutputKey('all_modified_files', outputPrefix), | ||||||
|     value: allModifiedFiles, |     value: allModifiedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('all_modified_files_count', outputPrefix), | ||||||
|  |     value: allModifiedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('any_modified', outputPrefix), |     key: getOutputKey('any_modified', outputPrefix), | ||||||
|     value: allModifiedFiles.length > 0 && filePatterns.length > 0, |     value: allModifiedFiles.paths.length > 0 && filePatterns.length > 0, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -231,16 +296,16 @@ export const setChangedFilesOutput = async ({ | |||||||
|     ] |     ] | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
|   const otherModifiedFiles = allOtherModifiedFiles |   const otherModifiedFiles = allOtherModifiedFiles.paths | ||||||
|     .split(inputs.separator) |     .split(inputs.separator) | ||||||
|     .filter( |     .filter( | ||||||
|       (filePath: string) => |       (filePath: string) => | ||||||
|         !allModifiedFiles.split(inputs.separator).includes(filePath) |         !allModifiedFiles.paths.split(inputs.separator).includes(filePath) | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|   const onlyModified = |   const onlyModified = | ||||||
|     otherModifiedFiles.length === 0 && |     otherModifiedFiles.length === 0 && | ||||||
|     allModifiedFiles.length > 0 && |     allModifiedFiles.paths.length > 0 && | ||||||
|     filePatterns.length > 0 |     filePatterns.length > 0 | ||||||
| 
 | 
 | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
| @ -255,6 +320,12 @@ export const setChangedFilesOutput = async ({ | |||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('other_modified_files_count', outputPrefix), | ||||||
|  |     value: otherModifiedFiles.length.toString(), | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|   const deletedFiles = await getChangeTypeFiles({ |   const deletedFiles = await getChangeTypeFiles({ | ||||||
|     inputs, |     inputs, | ||||||
|     changedFiles: allFilteredDiffFiles, |     changedFiles: allFilteredDiffFiles, | ||||||
| @ -263,13 +334,19 @@ export const setChangedFilesOutput = async ({ | |||||||
|   core.debug(`Deleted files: ${deletedFiles}`) |   core.debug(`Deleted files: ${deletedFiles}`) | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('deleted_files', outputPrefix), |     key: getOutputKey('deleted_files', outputPrefix), | ||||||
|     value: deletedFiles, |     value: deletedFiles.paths, | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('deleted_files_count', outputPrefix), | ||||||
|  |     value: deletedFiles.count, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
|     key: getOutputKey('any_deleted', outputPrefix), |     key: getOutputKey('any_deleted', outputPrefix), | ||||||
|     value: deletedFiles.length > 0 && filePatterns.length > 0, |     value: deletedFiles.paths.length > 0 && filePatterns.length > 0, | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
| @ -279,15 +356,15 @@ export const setChangedFilesOutput = async ({ | |||||||
|     changeTypes: [ChangeTypeEnum.Deleted] |     changeTypes: [ChangeTypeEnum.Deleted] | ||||||
|   }) |   }) | ||||||
| 
 | 
 | ||||||
|   const otherDeletedFiles = allOtherDeletedFiles |   const otherDeletedFiles = allOtherDeletedFiles.paths | ||||||
|     .split(inputs.separator) |     .split(inputs.separator) | ||||||
|     .filter( |     .filter( | ||||||
|       filePath => !deletedFiles.split(inputs.separator).includes(filePath) |       filePath => !deletedFiles.paths.split(inputs.separator).includes(filePath) | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|   const onlyDeleted = |   const onlyDeleted = | ||||||
|     otherDeletedFiles.length === 0 && |     otherDeletedFiles.length === 0 && | ||||||
|     deletedFiles.length > 0 && |     deletedFiles.paths.length > 0 && | ||||||
|     filePatterns.length > 0 |     filePatterns.length > 0 | ||||||
| 
 | 
 | ||||||
|   await setOutput({ |   await setOutput({ | ||||||
| @ -301,4 +378,10 @@ export const setChangedFilesOutput = async ({ | |||||||
|     value: otherDeletedFiles.join(inputs.separator), |     value: otherDeletedFiles.join(inputs.separator), | ||||||
|     inputs |     inputs | ||||||
|   }) |   }) | ||||||
|  | 
 | ||||||
|  |   await setOutput({ | ||||||
|  |     key: getOutputKey('other_deleted_files_count', outputPrefix), | ||||||
|  |     value: otherDeletedFiles.length.toString(), | ||||||
|  |     inputs | ||||||
|  |   }) | ||||||
| } | } | ||||||
|  | |||||||
| @ -183,7 +183,12 @@ export async function run(): Promise<void> { | |||||||
|     core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`) |     core.debug(`All old new renamed files: ${allOldNewRenamedFiles}`) | ||||||
|     await setOutput({ |     await setOutput({ | ||||||
|       key: 'all_old_new_renamed_files', |       key: 'all_old_new_renamed_files', | ||||||
|       value: allOldNewRenamedFiles, |       value: allOldNewRenamedFiles.paths, | ||||||
|  |       inputs | ||||||
|  |     }) | ||||||
|  |     await setOutput({ | ||||||
|  |       key: 'all_old_new_renamed_files_count', | ||||||
|  |       value: allOldNewRenamedFiles.count, | ||||||
|       inputs |       inputs | ||||||
|     }) |     }) | ||||||
|     core.info('All Done!') |     core.info('All Done!') | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tonye Jack
						Tonye Jack