2022-04-08 05:43:01 -04:00
name : Changed Files
2022-04-08 05:41:00 -04:00
description : Get all Added, Copied, Modified, Deleted, Renamed, Type changed, Unmerged, Unknown files.
2021-03-04 21:36:52 -05:00
author : tj-actions
2021-10-21 12:00:00 -04:00
2021-03-04 21:36:52 -05:00
inputs :
2021-03-05 07:25:17 -05:00
separator :
2022-06-12 10:08:13 -04:00
description : "Split character for output strings"
2022-05-14 14:33:40 -04:00
required : false
2021-03-05 07:25:17 -05:00
default : " "
2022-05-25 17:47:58 -04:00
include_all_old_new_renamed_files :
2022-10-29 15:48:36 -06:00
description : "Include `all_old_new_renamed_files` output. Note this can generate a large output See: [#501](https://github.com/tj-actions/changed-files/issues/501)."
2022-05-25 17:47:58 -04:00
required : false
2022-06-12 10:08:13 -04:00
default : "false"
2022-05-14 15:24:13 -04:00
old_new_separator :
2022-10-29 15:48:36 -06:00
description : "Split character for old and new filename pairs."
2022-05-14 14:33:40 -04:00
required : false
default : ","
2022-05-14 15:24:13 -04:00
old_new_files_separator :
2022-10-29 15:48:36 -06:00
description : "Split character for multiple old and new filename pairs."
2022-05-14 15:24:13 -04:00
required : false
default : " "
2021-07-17 11:46:59 -04:00
files_from_source_file :
2022-10-29 15:48:36 -06:00
description : "Source file(s) used to populate the `files` input."
2021-07-17 10:51:08 -04:00
required : false
default : ""
2021-04-30 12:04:23 -04:00
files :
2022-10-29 15:48:36 -06:00
description : "File and directory patterns to detect changes using only these list of file(s) (Defaults to the entire repo) **NOTE:** Multiline file/directory patterns should not include qoutes."
2021-04-30 12:04:23 -04:00
required : false
default : ""
2022-02-14 22:33:45 -05:00
files_separator :
2022-10-29 15:48:36 -06:00
description : "Separator used to split the `files` input"
2022-02-07 22:52:51 -05:00
default : "\n"
required : false
2022-02-14 22:33:45 -05:00
files_ignore :
2022-10-29 15:48:36 -06:00
description : "Ignore changes to these file(s) **NOTE:** Multiline file/directory patterns should not include qoutes."
2022-02-14 22:33:45 -05:00
required : false
default : ""
files_ignore_separator :
2022-10-29 15:48:36 -06:00
description : "Separator used to split the `files-ignore` input"
2022-02-14 22:33:45 -05:00
default : "\n"
required : false
files_ignore_from_source_file :
2022-10-29 15:48:36 -06:00
description : "Source file(s) used to populate the `files_ignore` input"
2022-02-14 22:33:45 -05:00
required : false
default : ""
2021-07-14 23:57:17 +03:00
sha :
2022-10-29 15:48:36 -06:00
description : "Specify a different commit SHA used for comparing changes"
2021-07-14 23:57:17 +03:00
required : true
default : ${{ github.sha }}
2021-07-17 11:46:59 -04:00
base_sha :
2022-10-29 15:48:36 -06:00
description : "Specify a different base commit SHA used for comparing changes"
2021-07-17 11:46:59 -04:00
required : false
2022-08-20 20:23:21 -06:00
since :
2022-10-29 15:48:36 -06:00
description : "Get changed files for commits whose timestamp is older than the given time."
2022-08-20 20:23:21 -06:00
required : false
2022-09-07 09:43:10 -06:00
default : ""
2022-08-20 20:23:21 -06:00
until :
2022-10-29 15:48:36 -06:00
description : "Get changed files for commits whose timestamp is earlier than the given time."
2022-08-20 20:23:21 -06:00
required : false
2022-09-07 09:43:10 -06:00
default : ""
2021-08-28 04:53:03 +03:00
path :
2022-10-29 15:48:36 -06:00
description : "Specify a relative path under `$GITHUB_WORKSPACE` to locate the repository."
2021-08-28 04:53:03 +03:00
required : false
2022-06-12 10:08:13 -04:00
default : "."
2022-04-28 02:08:15 -04:00
quotepath :
2022-10-29 15:48:36 -06:00
description : "Use non ascii characters to match files and output the filenames completely verbatim by setting this to `false`"
2022-06-12 10:08:13 -04:00
default : "true"
2022-04-28 02:08:15 -04:00
required : false
2022-06-02 12:13:45 -04:00
diff_relative :
2022-10-29 15:48:36 -06:00
description : "Exclude changes outside the current directory and show pathnames relative to it. **NOTE:** This requires you to specify the top level directory via the `path` input."
2022-06-12 10:08:13 -04:00
required : false
dir_names :
default : "false"
2022-10-29 15:48:36 -06:00
description : "Output unique changed directories instead of filenames. **NOTE:** This returns `.` for changed files located in the root of the project."
2022-06-02 12:13:45 -04:00
required : false
2022-08-03 14:01:40 -06:00
json :
2022-10-29 15:48:36 -06:00
description : "Output list of changed files in a JSON formatted string which can be used for matrix jobs."
2022-08-03 14:01:40 -06:00
required : false
default : "false"
2022-10-25 14:12:36 -06:00
max_fetch_depth :
description : "Max limit for fetching branch history. **NOTE**: This can be adjusted to resolve errors with insufficient history."
2022-10-12 12:39:24 -06:00
required : false
2022-10-30 17:49:12 -06:00
default : "140"
2021-03-05 07:25:17 -05:00
2021-03-04 22:43:17 -05:00
outputs :
added_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Added (A)."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.added_files }}
2021-03-04 22:43:17 -05:00
copied_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Copied (C)."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.copied_files }}
2021-03-04 22:43:17 -05:00
deleted_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Deleted (D)."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.deleted_files }}
2021-03-04 22:43:17 -05:00
modified_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Modified (M)."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.modified_files }}
2021-03-04 22:43:17 -05:00
renamed_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Renamed (R)."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.renamed_files }}
2022-05-14 17:54:38 -04:00
all_old_new_renamed_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Renamed and list their old and new names. **NOTE:** This requires setting `include_all_old_new_renamed_files` to `true` (R)"
2022-05-14 17:54:38 -04:00
value : ${{ steps.changed-files.outputs.all_old_new_renamed_files }}
2021-06-18 19:28:02 -04:00
type_changed_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that have their file type changed (T)."
2021-06-18 19:28:02 -04:00
value : ${{ steps.changed-files.outputs.type_changed_files }}
2021-03-04 22:43:17 -05:00
unmerged_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Unmerged (U)."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.unmerged_files }}
2021-03-04 22:43:17 -05:00
unknown_files :
2022-10-29 15:48:36 -06:00
description : "Returns only files that are Unknown (X)."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.unknown_files }}
2021-09-04 09:42:11 -04:00
all_changed_and_modified_files :
2022-10-29 15:48:36 -06:00
description : "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*"
2021-09-04 09:42:11 -04:00
value : ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
2021-12-14 00:21:49 -05:00
all_changed_files :
2022-10-29 15:48:36 -06:00
description : "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*"
2021-12-14 00:21:49 -05:00
value : ${{ steps.changed-files.outputs.all_changed_files }}
2021-05-01 13:32:09 -04:00
any_changed :
2022-10-29 15:48:36 -06:00
description : "Returns `true` when any of the filenames provided using the `files` input has changed. If no `files` have been specified,an empty string `''` is returned. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
2021-06-18 10:19:28 -04:00
value : ${{ steps.changed-files.outputs.any_changed }}
2021-07-17 15:13:26 -04:00
only_changed :
2022-10-29 15:48:36 -06:00
description : "Returns `true` when only files provided using the `files` input has changed. If no `files` have been specified,an empty string `''` is returned. i.e. *using a combination of all added, copied, modified and renamed files (ACMR)*."
2021-07-17 15:13:26 -04:00
value : ${{ steps.changed-files.outputs.only_changed }}
other_changed_files :
2022-10-29 15:48:36 -06:00
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)*."
2021-07-17 15:13:26 -04:00
value : ${{ steps.changed-files.outputs.other_changed_files }}
2021-12-14 02:01:31 -05:00
all_modified_files :
2022-10-29 15:48:36 -06:00
description : "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*."
2021-12-14 02:01:31 -05:00
value : ${{ steps.changed-files.outputs.all_modified_files }}
any_modified :
2022-10-29 15:48:36 -06:00
description : "Returns `true` when any of the filenames provided using the `files` input has been modified. If no `files` have been specified,an empty string `''` is returned. i.e. *using a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*."
2021-12-14 02:01:31 -05:00
value : ${{ steps.changed-files.outputs.any_modified }}
only_modified :
2022-10-29 15:48:36 -06:00
description : "Returns `true` when only files provided using the `files` input has been modified. If no `files` have been specified,an empty string `''` is returned.(ACMRD)."
2021-12-14 02:01:31 -05:00
value : ${{ steps.changed-files.outputs.only_modified }}
other_modified_files :
2022-10-29 15:48:36 -06:00
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)*"
2021-12-14 02:01:31 -05:00
value : ${{ steps.changed-files.outputs.other_modified_files }}
2021-09-05 08:22:47 -04:00
any_deleted :
2022-10-29 15:48:36 -06:00
description : "Returns `true` when any of the filenames provided using the `files` input has been deleted. If no `files` have been specified,an empty string `''` is returned. (D)"
2021-09-05 08:22:47 -04:00
value : ${{ steps.changed-files.outputs.any_deleted }}
only_deleted :
2022-10-29 15:48:36 -06:00
description : "Returns `true` when only files provided using the `files` input has been deleted. If no `files` have been specified,an empty string `''` is returned. (D)"
2021-09-05 08:22:47 -04:00
value : ${{ steps.changed-files.outputs.only_deleted }}
other_deleted_files :
2022-10-29 15:48:36 -06:00
description : "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
2021-09-05 08:22:47 -04:00
value : ${{ steps.changed-files.outputs.other_deleted_files }}
2021-03-04 21:36:52 -05:00
runs :
2022-06-12 10:08:13 -04:00
using : "composite"
2021-06-18 10:19:28 -04:00
steps :
2022-02-14 18:28:12 -05:00
- run : |
2022-02-17 03:00:58 -05:00
# "Calculating the previous and current SHA..."
2022-02-14 18:28:12 -05:00
bash $GITHUB_ACTION_PATH/diff-sha.sh
id : changed-files-diff-sha
shell : bash
env :
GITHUB_SERVER_URL : ${{ github.server_url }}
GITHUB_REPOSITORY : ${{ github.repository }}
GITHUB_BASE_REF : ${{ github.base_ref }}
2022-02-17 02:35:49 -05:00
GITHUB_HEAD_REF : ${{ github.head_ref }}
2022-05-29 20:32:23 -04:00
GITHUB_WORKSPACE : ${{ github.workspace }}
2022-10-12 12:39:24 -06:00
GITHUB_EVENT_PULL_REQUEST_BASE_SHA : ${{ github.event.pull_request.base.sha }}
2022-09-24 19:08:58 -06:00
GITHUB_EVENT_BEFORE : ${{ github.event.before }}
2022-10-12 12:39:24 -06:00
GITHUB_EVENT_FORCED : ${{ github.event.forced }}
2022-02-14 18:28:12 -05:00
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
2022-09-24 00:34:19 -06:00
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
2022-10-14 12:59:47 -06:00
INPUT_SHA : ${{ inputs.sha }}
INPUT_BASE_SHA : ${{ inputs.base_sha }}
INPUT_SINCE : ${{ inputs.since }}
INPUT_UNTIL : ${{ inputs.until }}
2022-02-14 18:28:12 -05:00
INPUT_PATH : ${{ inputs.path }}
2022-10-25 14:12:36 -06:00
INPUT_MAX_FETCH_DEPTH : ${{ inputs.max_fetch_depth }}
2022-01-04 21:38:03 -05:00
- name : Glob match
2022-10-11 10:17:54 +00:00
uses : tj-actions/glob@v15
2022-01-04 21:38:03 -05:00
id : glob
with :
2022-02-01 03:34:33 -05:00
files : ${{ inputs.files }}
2022-02-14 22:33:45 -05:00
files-separator : ${{ inputs.files_separator }}
excluded-files : ${{ inputs.files_ignore }}
excluded-files-separator : ${{ inputs.files_ignore_separator }}
2022-02-01 03:34:33 -05:00
files-from-source-file : ${{ inputs.files_from_source_file }}
2022-02-14 22:33:45 -05:00
excluded-files-from-source-file : ${{ inputs.files_ignore_from_source_file}}
2022-09-24 18:12:07 -06:00
escape-paths : true
2022-02-14 18:28:12 -05:00
working-directory : ${{ inputs.path }}
base-sha : ${{ steps.changed-files-diff-sha.outputs.previous_sha }}
sha : ${{ steps.changed-files-diff-sha.outputs.current_sha }}
2022-03-29 11:00:10 -04:00
include-deleted-files : true
2022-01-25 23:10:53 -05:00
separator : "|"
2021-06-18 10:19:28 -04:00
- run : |
2022-09-24 18:30:52 -06:00
bash $GITHUB_ACTION_PATH/get-changed-paths.sh
2021-06-18 10:19:28 -04:00
id : changed-files
shell : bash
env :
2022-05-29 20:32:23 -04:00
GITHUB_WORKSPACE : ${{ github.workspace }}
2022-10-20 13:19:57 -06:00
GITHUB_BASE_REF : ${{ github.base_ref }}
2021-06-18 10:19:28 -04:00
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
2022-09-04 17:21:34 -06:00
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
2022-03-14 01:01:27 -04:00
INPUT_FILES_PATTERN_FILE : ${{ steps.glob.outputs.paths-output-file }}
2021-06-18 10:19:28 -04:00
INPUT_SEPARATOR : ${{ inputs.separator }}
2021-08-28 04:53:03 +03:00
INPUT_PATH : ${{ inputs.path }}
2022-02-14 18:28:12 -05:00
INPUT_PREVIOUS_SHA : ${{ steps.changed-files-diff-sha.outputs.previous_sha }}
INPUT_CURRENT_SHA : ${{ steps.changed-files-diff-sha.outputs.current_sha }}
INPUT_TARGET_BRANCH : ${{ steps.changed-files-diff-sha.outputs.target_branch }}
INPUT_CURRENT_BRANCH : ${{ steps.changed-files-diff-sha.outputs.current_branch }}
2022-04-28 02:08:15 -04:00
INPUT_QUOTEPATH : ${{ inputs.quotepath }}
2022-05-25 17:47:58 -04:00
INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES : ${{ inputs.include_all_old_new_renamed_files }}
2022-05-14 15:24:13 -04:00
INPUT_OLD_NEW_SEPARATOR : ${{ inputs.old_new_separator }}
2022-05-14 14:33:40 -04:00
INPUT_OLD_NEW_FILES_SEPARATOR : ${{ inputs.old_new_files_separator }}
2022-06-02 12:13:45 -04:00
INPUT_DIFF_RELATIVE : ${{ inputs.diff_relative }}
2022-06-12 10:08:13 -04:00
INPUT_DIR_NAMES : ${{ inputs.dir_names }}
2022-08-03 14:01:40 -06:00
INPUT_JSON : ${{ inputs.json }}
2022-09-24 18:35:01 -06:00
INPUT_HAS_CUSTOM_PATTERNS : ${{ steps.glob.outputs.has-custom-patterns }}
2021-03-05 05:58:42 -05:00
2021-03-04 21:36:52 -05:00
branding :
2021-04-23 06:55:01 -04:00
icon : file-text
2021-03-04 21:36:52 -05:00
color : white