kong/Changed Files

Get all Added, Copied, Modified, Deleted, Renamed, Type changed, Unmerged, and Unknown files.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Mar 26, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: kong/changed-files@cd69b79ca4e2a1198064c5e6564cce68920df311 # no releases — HEAD as of 2026-07-11

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
separatorSplit character for output strings.no""
include_all_old_new_renamed_filesInclude `all_old_new_renamed_files` output. Note this can generate a large output See: #501.nofalse
old_new_separatorSplit character for old and new filename pairs.no,
old_new_files_separatorSplit character for old and new renamed filename pairs.no""
files_from_source_fileSource file(s) used to populate the `files` input.no""
files_from_source_file_separatorSeparator used to split the `files_from_source_file` input.no""
filesFile and directory patterns used to detect changes (Defaults to the entire repo if unset). NOTE: Multiline file/directory patterns should not include quotes. no""
files_separatorSeparator used to split the `files` inputno""
files_yamlYAML used to define a set of file patterns to detect changesno""
files_yaml_from_source_fileSource file(s) used to populate the `files_yaml` input. Example: https://github.com/tj-actions/changed-files/blob/main/test/changed-files.ymlno""
files_yaml_from_source_file_separatorSeparator used to split the `files_yaml_from_source_file` inputno""
files_ignore_yamlYAML used to define a set of file patterns to ignore changesno""
files_ignore_yaml_from_source_fileSource file(s) used to populate the `files_ignore_yaml` input. Example: https://github.com/tj-actions/changed-files/blob/main/test/changed-files.ymlno""
files_ignore_yaml_from_source_file_separatorSeparator used to split the `files_ignore_yaml_from_source_file` inputno""
files_ignoreIgnore changes to these file(s). NOTE: Multiline file/directory patterns should not include quotes.no""
files_ignore_separatorSeparator used to split the `files_ignore` inputno""
files_ignore_from_source_fileSource file(s) used to populate the `files_ignore` inputno""
files_ignore_from_source_file_separatorSeparator used to split the `files_ignore_from_source_file` inputno""
shaSpecify a different commit SHA or branch used for comparing changesno
base_shaSpecify a different base commit SHA or branch used for comparing changesno
sinceGet changed files for commits whose timestamp is older than the given time.no""
untilGet changed files for commits whose timestamp is earlier than the given time.no""
pathSpecify a relative path under `$GITHUB_WORKSPACE` to locate the repository.no.
quotepathUse non-ASCII characters to match files and output the filenames completely verbatim by setting this to `false`notrue
diff_relativeExclude changes outside the current directory and show path names relative to it. NOTE: This requires you to specify the top-level directory via the `path` input.notrue
dir_namesOutput unique changed directories instead of filenames. NOTE: This returns `.` for changed files located in the current working directory which defaults to `$GITHUB_WORKSPACE`.nofalse
dir_names_max_depthLimit the directory output to a maximum depth e.g `test/test1/test2` with max depth of `2` returns `test/test1`.no
dir_names_exclude_current_dirExclude the current directory represented by `.` from the output when `dir_names` is set to `true`.nofalse
dir_names_include_filesFile and directory patterns to include in the output when `dir_names` is set to `true`. NOTE: This returns only the matching files and also the directory names.no""
dir_names_include_files_separatorSeparator used to split the `dir_names_include_files` inputno""
dir_names_deleted_files_include_only_deleted_dirsInclude only directories that have been deleted as opposed to directory names of files that have been deleted in the `deleted_files` output when `dir_names` is set to `true`.nofalse
jsonOutput list of changed files in a JSON formatted string which can be used for matrix jobs. Example: https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-example.ymlnofalse
escape_jsonEscape JSON output.notrue
safe_outputApply sanitization to output filenames before being set as output.notrue
fetch_depthDepth of additional branch history fetched. NOTE: This can be adjusted to resolve errors with insufficient history.no25
skip_initial_fetchSkip initially fetching additional history to improve performance for shallow repositories. NOTE: This could lead to errors with missing history. It's intended to be used when you've fetched all necessary history to perform the diff. nofalse
fetch_additional_submodule_historyFetch additional history for submodules.nofalse
since_last_remote_commitUse the last commit on the remote branch as the `base_sha`. Defaults to the last non-merge commit on the target branch for pull request events and the previous remote commit of the current branch for push events.nofalse
write_output_filesWrite outputs to the `output_dir` defaults to `.github/outputs` folder. NOTE: This creates a `.txt` file by default and a `.json` file if `json` is set to `true`.nofalse
output_dirDirectory to store output files.no.github/outputs
output_renamed_files_as_deleted_and_addedOutput renamed files as deleted and added files.nofalse
recover_deleted_filesRecover deleted files.nofalse
recover_deleted_files_to_destinationRecover deleted files to a new destination directory, defaults to the original location.no""
recover_filesFile and directory patterns used to recover deleted files, defaults to the patterns provided via the `files`, `files_from_source_file`, `files_ignore` and `files_ignore_from_source_file` inputs or all deleted files if no patterns are provided. no""
recover_files_separatorSeparator used to split the `recover_files` inputno""
recover_files_ignoreFile and directory patterns to ignore when recovering deleted files.no""
recover_files_ignore_separatorSeparator used to split the `recover_files_ignore` inputno""
tokenGitHub token used to fetch changed files from Github's API.no${{ github.token }}
api_urlGithub API URL.no${{ github.api_url }}
use_rest_apiForce the use of Github's REST API even when a local copy of the repository existsnofalse
fail_on_initial_diff_errorFail when the initial diff fails.nofalse
fail_on_submodule_diff_errorFail when the submodule diff fails.nofalse
negation_patterns_firstApply the negation patterns first. NOTE: This affects how changed files are matched.nofalse
matrixOutput changed files in a format that can be used for matrix jobs. Alias for setting inputs `json` to `true` and `escape_json` to `false`.nofalse
exclude_submodulesExclude changes to submodules.nofalse
exclude_symlinksExclude symlinks from changed files.nofalse
skip_same_shaDo not fail when base and head SHAs are identical.nofalse
fetch_missing_history_max_retriesMaximum number of retries to fetch missing history.no20
use_posix_path_separatorUse POSIX path separator `/` for output file paths on Windows.nofalse
tags_patternTags pattern to include.no*
tags_ignore_patternTags pattern to ignore.no""
namedescription
added_filesReturns only files that are Added (A).
added_files_countReturns the number of `added_files`
any_addedReturns `true` when any of the filenames provided using the `files*` or `files_ignore*` inputs have been added.
copied_filesReturns only files that are Copied (C).
copied_files_countReturns the number of `copied_files`
deleted_filesReturns only files that are Deleted (D).
deleted_files_countReturns the number of `deleted_files`
modified_filesReturns only files that are Modified (M).
modified_files_countReturns the number of `modified_files`
renamed_filesReturns only files that are Renamed (R).
renamed_files_countReturns the number of `renamed_files`
all_old_new_renamed_filesReturns 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_countReturns the number of `all_old_new_renamed_files`
type_changed_filesReturns only files that have their file type changed (T).
type_changed_files_countReturns the number of `type_changed_files`
unmerged_filesReturns only files that are Unmerged (U).
unmerged_files_countReturns the number of `unmerged_files`
unknown_filesReturns only files that are Unknown (X).
unknown_files_countReturns the number of `unknown_files`
all_changed_and_modified_filesReturns all changed and modified files i.e. a combination of (ACMRDTUX)
all_changed_and_modified_files_countReturns the number of `all_changed_and_modified_files`
all_changed_filesReturns all changed files i.e. a combination of all added, copied, modified and renamed files (ACMR)
all_changed_files_countReturns the number of `all_changed_files`
any_changedReturns `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)*.
only_changedReturns `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)*.
other_changed_filesReturns all other changed files not listed in the files input i.e. includes a combination of all added, copied, modified and renamed files (ACMR).
other_changed_files_countReturns the number of `other_changed_files`
all_modified_filesReturns all changed files i.e. a combination of all added, copied, modified, renamed and deleted files (ACMRD).
all_modified_files_countReturns the number of `all_modified_files`
any_modifiedReturns `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)*.
only_modifiedReturns `true` when only files provided using the `files*` or `files_ignore*` inputs have been modified. (ACMRD).
other_modified_filesReturns 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_countReturns the number of `other_modified_files`
any_deletedReturns `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)
only_deletedReturns `true` when only files provided using the `files*` or `files_ignore*` inputs have been deleted. (D)
other_deleted_filesReturns all other deleted files not listed in the files input i.e. a combination of all deleted files (D)
other_deleted_files_countReturns the number of `other_deleted_files`
modified_keysReturns all modified YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and deleted (ACMRD)
changed_keysReturns all changed YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and renamed (ACMR)