2022-04-08 09:43:01 +00:00
|
|
|
name: Changed Files
|
2022-04-08 09:41:00 +00:00
|
|
|
description: Get all Added, Copied, Modified, Deleted, Renamed, Type changed, Unmerged, Unknown files.
|
2021-03-05 02:36:52 +00:00
|
|
|
author: tj-actions
|
2021-10-21 16:00:00 +00:00
|
|
|
|
2021-03-05 02:36:52 +00:00
|
|
|
inputs:
|
2021-05-06 12:44:56 +00:00
|
|
|
token:
|
|
|
|
description: 'Github token'
|
2022-05-14 18:33:40 +00:00
|
|
|
required: false
|
2021-05-06 12:44:56 +00:00
|
|
|
default: ${{ github.token }}
|
2021-03-05 12:25:17 +00:00
|
|
|
separator:
|
2022-05-14 18:54:45 +00:00
|
|
|
description: 'Split character for output strings'
|
2022-05-14 18:33:40 +00:00
|
|
|
required: false
|
2021-03-05 12:25:17 +00:00
|
|
|
default: " "
|
2022-05-25 21:47:58 +00:00
|
|
|
include_all_old_new_renamed_files:
|
|
|
|
description: 'Include all_old_new_renamed_files output. Note this can generate a large debug output See: #501.'
|
|
|
|
required: false
|
|
|
|
default: false
|
2022-05-14 19:24:13 +00:00
|
|
|
old_new_separator:
|
2022-05-14 18:33:40 +00:00
|
|
|
description: 'Split character for old and new filename pairs'
|
|
|
|
required: false
|
|
|
|
default: ","
|
2022-05-14 19:24:13 +00:00
|
|
|
old_new_files_separator:
|
|
|
|
description: 'Split character for multiple old and new filename pairs'
|
|
|
|
required: false
|
|
|
|
default: " "
|
2021-07-17 15:46:59 +00:00
|
|
|
files_from_source_file:
|
2022-02-15 03:33:45 +00:00
|
|
|
description: 'Source file(s) to populate the files input'
|
2021-07-17 14:51:08 +00:00
|
|
|
required: false
|
|
|
|
default: ""
|
2021-04-30 16:04:23 +00:00
|
|
|
files:
|
2021-06-21 22:36:10 +00:00
|
|
|
description: 'Check for changes using only this list of files (Defaults to the entire repo)'
|
2021-04-30 16:04:23 +00:00
|
|
|
required: false
|
|
|
|
default: ""
|
2022-02-15 03:33:45 +00:00
|
|
|
files_separator:
|
2022-02-08 03:52:51 +00:00
|
|
|
description: 'Separator used to split the files input'
|
|
|
|
default: "\n"
|
|
|
|
required: false
|
2022-02-15 03:33:45 +00:00
|
|
|
files_ignore:
|
|
|
|
description: 'Ignore changes to this list of files'
|
|
|
|
required: false
|
|
|
|
default: ""
|
|
|
|
files_ignore_separator:
|
|
|
|
description: 'Separator used to split the files-ignore input'
|
|
|
|
default: "\n"
|
|
|
|
required: false
|
|
|
|
files_ignore_from_source_file:
|
|
|
|
description: 'Source file(s) to populate the files-ignore input'
|
|
|
|
required: false
|
|
|
|
default: ""
|
2021-07-14 20:57:17 +00:00
|
|
|
sha:
|
2021-07-17 15:46:59 +00:00
|
|
|
description: 'Specify a current commit SHA used for comparing changes'
|
2021-07-14 20:57:17 +00:00
|
|
|
required: true
|
|
|
|
default: ${{ github.sha }}
|
2021-07-17 15:46:59 +00:00
|
|
|
base_sha:
|
|
|
|
description: 'Specify a base commit SHA on used for comparing changes'
|
|
|
|
required: false
|
2021-10-30 19:55:58 +00:00
|
|
|
since_last_remote_commit:
|
|
|
|
description: 'Use the last commit on the remote branch as the base_sha for push event.'
|
|
|
|
required: false
|
|
|
|
default: 'false'
|
2021-08-28 01:53:03 +00:00
|
|
|
path:
|
|
|
|
description: 'Specify a relative path under $GITHUB_WORKSPACE to locate the repository'
|
|
|
|
required: false
|
2022-05-31 03:19:40 +00:00
|
|
|
default: '.'
|
2022-02-17 07:35:49 +00:00
|
|
|
use_fork_point:
|
|
|
|
description: 'Finds best common ancestor between two commits to use in a three-way merge as the base_sha'
|
|
|
|
default: 'false'
|
|
|
|
required: false
|
2022-04-28 06:08:15 +00:00
|
|
|
quotepath:
|
|
|
|
description: 'Output filenames completely verbatim by setting this to false'
|
|
|
|
default: 'true'
|
|
|
|
required: false
|
2022-06-02 16:13:45 +00:00
|
|
|
diff_relative:
|
|
|
|
description: 'Exclude changes outside the current directory and show pathnames relative to it'
|
|
|
|
required: false
|
2021-03-05 12:25:17 +00:00
|
|
|
|
2021-03-05 03:43:17 +00:00
|
|
|
outputs:
|
|
|
|
added_files:
|
|
|
|
description: List of added files.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.added_files }}
|
2021-03-05 03:43:17 +00:00
|
|
|
copied_files:
|
|
|
|
description: List of copied files.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.copied_files }}
|
2021-03-05 03:43:17 +00:00
|
|
|
deleted_files:
|
|
|
|
description: List of deleted files.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.deleted_files }}
|
2021-03-05 03:43:17 +00:00
|
|
|
modified_files:
|
2021-03-05 11:03:04 +00:00
|
|
|
description: List of modified files.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.modified_files }}
|
2021-03-05 03:43:17 +00:00
|
|
|
renamed_files:
|
|
|
|
description: List of renamed files.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.renamed_files }}
|
2022-05-14 21:54:38 +00:00
|
|
|
all_old_new_renamed_files:
|
|
|
|
description: List of all old and new names of renamed files.
|
|
|
|
value: ${{ steps.changed-files.outputs.all_old_new_renamed_files }}
|
2021-06-18 23:28:02 +00:00
|
|
|
type_changed_files:
|
|
|
|
description: List of files that had type changes.
|
|
|
|
value: ${{ steps.changed-files.outputs.type_changed_files }}
|
2021-03-05 03:43:17 +00:00
|
|
|
unmerged_files:
|
|
|
|
description: List of unmerged files.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.unmerged_files }}
|
2021-03-05 03:43:17 +00:00
|
|
|
unknown_files:
|
|
|
|
description: List of unknown files.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.unknown_files }}
|
2021-09-04 13:42:11 +00:00
|
|
|
all_changed_and_modified_files:
|
2021-03-05 03:43:17 +00:00
|
|
|
description: List of all changed files.
|
2021-09-04 13:42:11 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
|
2021-12-14 05:21:49 +00:00
|
|
|
all_changed_files:
|
2021-12-14 07:01:31 +00:00
|
|
|
description: List of all copied, modified, and added files.
|
2021-12-14 05:21:49 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.all_changed_files }}
|
2021-05-01 17:32:09 +00:00
|
|
|
any_changed:
|
|
|
|
description: Return true only when any files provided using the files input have changed.
|
2021-06-18 14:19:28 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.any_changed }}
|
2021-07-17 19:13:26 +00:00
|
|
|
only_changed:
|
2021-09-05 12:22:47 +00:00
|
|
|
description: Return true when all files provided using the files input have changed.
|
2021-07-17 19:13:26 +00:00
|
|
|
value: ${{ steps.changed-files.outputs.only_changed }}
|
|
|
|
other_changed_files:
|
|
|
|
description: Return list of changed files not listed in the files input.
|
|
|
|
value: ${{ steps.changed-files.outputs.other_changed_files }}
|
2021-12-14 07:01:31 +00:00
|
|
|
all_modified_files:
|
|
|
|
description: List of all copied, modified, added and deleted files.
|
|
|
|
value: ${{ steps.changed-files.outputs.all_modified_files }}
|
|
|
|
any_modified:
|
|
|
|
description: Return true only when any files provided using the files input have been modified.
|
|
|
|
value: ${{ steps.changed-files.outputs.any_modified }}
|
|
|
|
only_modified:
|
|
|
|
description: Return true when all files provided using the files input have been modified.
|
|
|
|
value: ${{ steps.changed-files.outputs.only_modified }}
|
|
|
|
other_modified_files:
|
|
|
|
description: Return list of modified files not listed in the files input.
|
|
|
|
value: ${{ steps.changed-files.outputs.other_modified_files }}
|
2021-09-05 12:22:47 +00:00
|
|
|
any_deleted:
|
|
|
|
description: Return true only when any files provided using the files input have been deleted.
|
|
|
|
value: ${{ steps.changed-files.outputs.any_deleted }}
|
|
|
|
only_deleted:
|
|
|
|
description: Return true when all files provided using the files input have been deleted.
|
|
|
|
value: ${{ steps.changed-files.outputs.only_deleted }}
|
|
|
|
other_deleted_files:
|
|
|
|
description: Return list of deleted files not listed in the files input.
|
|
|
|
value: ${{ steps.changed-files.outputs.other_deleted_files }}
|
2021-03-05 02:36:52 +00:00
|
|
|
|
|
|
|
runs:
|
2021-06-18 14:19:28 +00:00
|
|
|
using: 'composite'
|
|
|
|
steps:
|
2022-01-09 08:18:29 +00:00
|
|
|
- run: |
|
|
|
|
# "Set base sha..."
|
|
|
|
if [[ -n "${{ inputs.base_sha }}" ]]; then
|
|
|
|
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
|
2022-02-18 04:23:53 +00:00
|
|
|
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
2022-01-09 08:18:29 +00:00
|
|
|
echo "::set-output name=base_sha::${{ github.event.before }}"
|
|
|
|
fi
|
|
|
|
id: base-sha
|
|
|
|
shell: bash
|
2022-02-14 23:28:12 +00:00
|
|
|
- run: |
|
2022-02-17 08:00:58 +00:00
|
|
|
# "Calculating the previous and current SHA..."
|
2022-02-14 23:28:12 +00: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 07:35:49 +00:00
|
|
|
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
2022-02-14 23:28:12 +00:00
|
|
|
GITHUB_ACTION_PATH: ${{ github.action_path }}
|
2022-05-30 00:32:23 +00:00
|
|
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
2022-02-14 23:28:12 +00:00
|
|
|
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
|
|
|
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
|
|
|
INPUT_SHA: ${{ inputs.sha }}
|
|
|
|
INPUT_BASE_SHA: ${{ steps.base-sha.outputs.base_sha }}
|
|
|
|
INPUT_TOKEN: ${{ inputs.token }}
|
|
|
|
INPUT_PATH: ${{ inputs.path }}
|
2022-02-17 07:35:49 +00:00
|
|
|
INPUT_USE_FORK_POINT: ${{ inputs.use_fork_point }}
|
2022-01-05 02:38:03 +00:00
|
|
|
- name: Glob match
|
2022-05-31 16:48:35 +00:00
|
|
|
uses: tj-actions/glob@v9.2
|
2022-01-05 02:38:03 +00:00
|
|
|
id: glob
|
|
|
|
with:
|
2022-02-01 08:34:33 +00:00
|
|
|
files: ${{ inputs.files }}
|
2022-02-15 03:33:45 +00:00
|
|
|
files-separator: ${{ inputs.files_separator }}
|
2022-03-29 15:00:10 +00:00
|
|
|
escape-paths: true
|
2022-02-15 03:33:45 +00:00
|
|
|
excluded-files: ${{ inputs.files_ignore }}
|
|
|
|
excluded-files-separator: ${{ inputs.files_ignore_separator }}
|
2022-02-01 08:34:33 +00:00
|
|
|
files-from-source-file: ${{ inputs.files_from_source_file }}
|
2022-02-15 03:33:45 +00:00
|
|
|
excluded-files-from-source-file: ${{ inputs.files_ignore_from_source_file}}
|
2022-02-14 23:28:12 +00: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 15:00:10 +00:00
|
|
|
include-deleted-files: true
|
2022-01-26 04:10:53 +00:00
|
|
|
separator: "|"
|
2021-06-18 14:19:28 +00:00
|
|
|
- run: |
|
|
|
|
bash $GITHUB_ACTION_PATH/entrypoint.sh
|
|
|
|
id: changed-files
|
|
|
|
shell: bash
|
|
|
|
env:
|
2022-02-14 23:28:12 +00:00
|
|
|
GITHUB_ACTION_PATH: ${{ github.action_path }}
|
2022-05-30 00:32:23 +00:00
|
|
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
2021-06-18 14:19:28 +00:00
|
|
|
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
|
|
|
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
|
2022-03-14 05:01:27 +00:00
|
|
|
INPUT_FILES_PATTERN_FILE: ${{ steps.glob.outputs.paths-output-file }}
|
2021-06-18 14:19:28 +00:00
|
|
|
INPUT_SEPARATOR: ${{ inputs.separator }}
|
2021-08-28 01:53:03 +00:00
|
|
|
INPUT_PATH: ${{ inputs.path }}
|
2022-02-14 23:28:12 +00: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 06:08:15 +00:00
|
|
|
INPUT_QUOTEPATH: ${{ inputs.quotepath }}
|
2022-05-25 21:47:58 +00:00
|
|
|
INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES: ${{ inputs.include_all_old_new_renamed_files }}
|
2022-05-14 19:24:13 +00:00
|
|
|
INPUT_OLD_NEW_SEPARATOR: ${{ inputs.old_new_separator }}
|
2022-05-14 18:33:40 +00:00
|
|
|
INPUT_OLD_NEW_FILES_SEPARATOR: ${{ inputs.old_new_files_separator }}
|
2022-06-02 16:13:45 +00:00
|
|
|
INPUT_DIFF_RELATIVE: ${{ inputs.diff_relative }}
|
2021-03-05 10:58:42 +00:00
|
|
|
|
2021-03-05 02:36:52 +00:00
|
|
|
branding:
|
2021-04-23 10:55:01 +00:00
|
|
|
icon: file-text
|
2021-03-05 02:36:52 +00:00
|
|
|
color: white
|