Revert "feat: Added support for returning old and new names of renamed files" (#485)
This commit is contained in:
parent
3baba75579
commit
0093196671
37
.github/workflows/test.yml
vendored
37
.github/workflows/test.yml
vendored
@ -4,7 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- "**"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
@ -294,42 +293,6 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-specific-newline-source-file.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-specific-newline-source-file.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
- name: Run changed-files for old new filenames test rename 1
|
|
||||||
id: changed-files-all-old-new-renamed-files-1
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
base_sha: d1c0ee4
|
|
||||||
sha: 4d04215
|
|
||||||
- name: Show output
|
|
||||||
run: |
|
|
||||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}'
|
|
||||||
shell:
|
|
||||||
bash
|
|
||||||
- name: Check all_old_new_renamed_files output
|
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt')"
|
|
||||||
run: |
|
|
||||||
echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
|
|
||||||
exit 1
|
|
||||||
shell:
|
|
||||||
bash
|
|
||||||
- name: Run changed-files for old new filenames test rename 2
|
|
||||||
id: changed-files-all-old-new-renamed-files-2
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
base_sha: 4d04215
|
|
||||||
sha: fe238e6
|
|
||||||
- name: Show output
|
|
||||||
run: |
|
|
||||||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}'
|
|
||||||
shell:
|
|
||||||
bash
|
|
||||||
- name: Check all_old_new_renamed_files output
|
|
||||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt')"
|
|
||||||
run: |
|
|
||||||
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
|
|
||||||
exit 1
|
|
||||||
shell:
|
|
||||||
bash
|
|
||||||
- name: Run changed-files with specific files
|
- name: Run changed-files with specific files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: ./
|
uses: ./
|
||||||
|
55
README.md
55
README.md
@ -100,38 +100,35 @@ Support this project with a :star:
|
|||||||
| U | Unmerged |
|
| U | Unmerged |
|
||||||
| X | Unknown |
|
| X | Unknown |
|
||||||
|
|
||||||
| Output | type | example | description |
|
| Output | type | example | description |
|
||||||
|:----------------------------------:|:--------:|:--------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:----------------------------------:|:--------:|:--------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
| any\_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed. <br /> i.e. *using a combination of all added, <br />copied, modified and renamed files (ACMR)* |
|
| any\_changed | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has changed. <br /> i.e. *using a combination of all added, <br />copied, modified and renamed files (ACMR)* |
|
||||||
| only\_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has changed. (ACMR) |
|
| only\_changed | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has changed. (ACMR) |
|
||||||
| other\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other changed files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACMR)* |
|
| other\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other changed files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied and modified files (ACMR)* |
|
||||||
| any\_modified | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has been modified. <br /> i.e. *using a combination of all added, <br />copied, modified, renamed, and deleted files (ACMRD)* |
|
| any\_modified | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has been modified. <br /> i.e. *using a combination of all added, <br />copied, modified, renamed, and deleted files (ACMRD)* |
|
||||||
| only\_modified | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has been modified. (ACMRD) |
|
| only\_modified | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has been modified. (ACMRD) |
|
||||||
| other\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other modified files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied, modified, and deleted files (ACMRD)* |
|
| other\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other modified files <br/> not listed in the files input <br /> i.e. *a combination of all added, <br /> copied, modified, and deleted files (ACMRD)* |
|
||||||
| any\_deleted | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has been deleted. (D) |
|
| any\_deleted | `string` | `true` OR `false` | Returns `true` when any <br /> of the filenames provided using <br /> the `files` input has been deleted. (D) |
|
||||||
| only\_deleted | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has been deleted. (D) |
|
| only\_deleted | `string` | `true` OR `false` | Returns `true` when only <br /> files provided using <br /> the `files` input has been deleted. (D) |
|
||||||
| other\_deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other deleted files <br/> not listed in the files input <br /> i.e. *a combination of all deleted files (D)* |
|
| other\_deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select all other deleted files <br/> not listed in the files input <br /> i.e. *a combination of all deleted files (D)* |
|
||||||
| all\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified and renamed files (ACMR)* |
|
| all\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified and renamed files (ACMR)* |
|
||||||
| all\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified, renamed and deleted files (ACMRD)* |
|
| all\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed files <br /> i.e. *a combination of all added, <br />copied, modified, renamed and deleted files (ACMRD)* |
|
||||||
| all\_changed\_and\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed <br /> and modified files <br /> i.e. *a combination of (ACMRDTUX)* |
|
| all\_changed\_and\_modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select all changed <br /> and modified files <br /> i.e. *a combination of (ACMRDTUX)* |
|
||||||
| added\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Added (A) |
|
| added\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Added (A) |
|
||||||
| copied\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Copied (C) |
|
| copied\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Copied (C) |
|
||||||
| deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Deleted (D) |
|
| deleted\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Deleted (D) |
|
||||||
| modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Modified (M) |
|
| modified\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Modified (M) |
|
||||||
| renamed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Renamed (R) |
|
| renamed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Renamed (R) |
|
||||||
| all_old_new_renamed_files | `string` | `'old name.txt,new name.txt old name 2.txt,new name 2.txt...'` | Select only files that are Renamed and list their old and new names (R) |
|
| type\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that have their file type changed (T) |
|
||||||
| type\_changed\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that have their file type changed (T) |
|
| unmerged\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unmerged (U) |
|
||||||
| unmerged\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unmerged (U) |
|
| unknown\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unknown (X) |
|
||||||
| unknown\_files | `string` | `'new.txt path/to/file.png ...'` | Select only files that are Unknown (X) |
|
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
| Input | type | required | default | description |
|
| Input | type | required | default | description |
|
||||||
|:---------------------------------:|:----------------------:|:--------:|:---------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:---------------------------------:|:----------------------:|:--------:|:---------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
| token | `string` | `false` | `${{ github.token }}` | [GITHUB\_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
| token | `string` | `false` | `${{ github.token }}` | [GITHUB\_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
||||||
| separator | `string` | `false` | `' '` | Split character for output strings |
|
| separator | `string` | `true` | `' '` | Output string separator |
|
||||||
| old\_new\_separator | `string` | `false` | `','` | Split character for old and new filename pairs |
|
|
||||||
| old\_new\_files\_separator | `string` | `false` | `' '` | Split character for multiple old and new filename pairs |
|
|
||||||
| files | `string` OR `string[]` | `false` | | Check for changes <br> using only these <br> list of file(s) <br> (Defaults to the <br> entire repo) |
|
| files | `string` OR `string[]` | `false` | | Check for changes <br> using only these <br> list of file(s) <br> (Defaults to the <br> entire repo) |
|
||||||
| files\_separator | string | `false` | `'\n'` | Separator used to split the<br>`files` input |
|
| files\_separator | string | `false` | `'\n'` | Separator used to split the<br>`files` input |
|
||||||
| files\_from\_source\_file | `string` | `false` | | Source file(s) <br> used to populate <br> the `files` input |
|
| files\_from\_source\_file | `string` | `false` | | Source file(s) <br> used to populate <br> the `files` input |
|
||||||
@ -141,9 +138,9 @@ Support this project with a :star:
|
|||||||
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
|
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
|
||||||
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
|
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
|
||||||
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
||||||
| since\_last\_remote\_commit | `string` | `false` | `false` | Use the last commit on the remote <br> branch as the `base_sha` <br> (Defaults to the last commit <br> on the target branch for Pull requests <br> or the previous commit <br> on the current branch <br> for push events). <br /> NOTE: This requires <br /> `fetch-depth: 0` <br /> with `actions/checkout@v2` |
|
| since\_last\_remote\_commit | `string` | `false` | `false` | Use the last commit on the remote <br> branch as the `base_sha` <br> (Defaults to the last commit <br> on the target branch for Pull requests <br> or the previous commit <br> on the current branch <br> for push events). <br /> NOTE: This requires <br /> `fetch-depth: 0` <br /> with `actions/checkout@v2` |
|
||||||
| use\_fork\_point | `string` | `false` | `false` | Finds best common ancestor <br /> between two commits <br /> to use in a three-way merge <br /> as the `base_sha` <br /> See: [git merge-base](https://git-scm.com/docs/git-merge-base#Documentation/git-merge-base.txt---fork-point). <br> NOTE: This pulls the entire commit history of the base branch |
|
| use\_fork\_point | `string` | `false` | `false` | Finds best common ancestor <br /> between two commits <br /> to use in a three-way merge <br /> as the `base_sha` <br /> See: [git merge-base](https://git-scm.com/docs/git-merge-base#Documentation/git-merge-base.txt---fork-point). <br> NOTE: This pulls the entire commit history of the base branch |
|
||||||
| quotepath | `string` | `false` | `true` | Output filenames completely verbatim by setting this to `false` |
|
| quotepath | `string` | `false` | `true` | Output filenames completely verbatim by setting this to `false` |
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
19
action.yml
19
action.yml
@ -5,19 +5,11 @@ author: tj-actions
|
|||||||
inputs:
|
inputs:
|
||||||
token:
|
token:
|
||||||
description: 'Github token'
|
description: 'Github token'
|
||||||
required: false
|
required: true
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
separator:
|
separator:
|
||||||
description: 'Split character for output strings'
|
description: 'Split character for array output'
|
||||||
required: false
|
required: true
|
||||||
default: " "
|
|
||||||
old_new_separator:
|
|
||||||
description: 'Split character for old and new filename pairs'
|
|
||||||
required: false
|
|
||||||
default: ","
|
|
||||||
old_new_files_separator:
|
|
||||||
description: 'Split character for multiple old and new filename pairs'
|
|
||||||
required: false
|
|
||||||
default: " "
|
default: " "
|
||||||
files_from_source_file:
|
files_from_source_file:
|
||||||
description: 'Source file(s) to populate the files input'
|
description: 'Source file(s) to populate the files input'
|
||||||
@ -82,9 +74,6 @@ outputs:
|
|||||||
renamed_files:
|
renamed_files:
|
||||||
description: List of renamed files.
|
description: List of renamed files.
|
||||||
value: ${{ steps.changed-files.outputs.renamed_files }}
|
value: ${{ steps.changed-files.outputs.renamed_files }}
|
||||||
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 }}
|
|
||||||
type_changed_files:
|
type_changed_files:
|
||||||
description: List of files that had type changes.
|
description: List of files that had type changes.
|
||||||
value: ${{ steps.changed-files.outputs.type_changed_files }}
|
value: ${{ steps.changed-files.outputs.type_changed_files }}
|
||||||
@ -193,8 +182,6 @@ runs:
|
|||||||
INPUT_TARGET_BRANCH: ${{ steps.changed-files-diff-sha.outputs.target_branch }}
|
INPUT_TARGET_BRANCH: ${{ steps.changed-files-diff-sha.outputs.target_branch }}
|
||||||
INPUT_CURRENT_BRANCH: ${{ steps.changed-files-diff-sha.outputs.current_branch }}
|
INPUT_CURRENT_BRANCH: ${{ steps.changed-files-diff-sha.outputs.current_branch }}
|
||||||
INPUT_QUOTEPATH: ${{ inputs.quotepath }}
|
INPUT_QUOTEPATH: ${{ inputs.quotepath }}
|
||||||
INPUT_OLD_NEW_SEPARATOR: ${{ inputs.old_new_separator }}
|
|
||||||
INPUT_OLD_NEW_FILES_SEPARATOR: ${{ inputs.old_new_files_separator }}
|
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: file-text
|
icon: file-text
|
||||||
|
@ -31,24 +31,6 @@ function get_diff() {
|
|||||||
git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base" "$sha"
|
git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base" "$sha"
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_renames() {
|
|
||||||
base="$1"
|
|
||||||
sha="$2"
|
|
||||||
while IFS='' read -r sub; do
|
|
||||||
sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | grep '^[-]Subproject commit' | awk '{print $3}')"
|
|
||||||
sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | grep '^[+]Subproject commit' | awk '{print $3}')"
|
|
||||||
if [ -n "$sub_commit_cur" ]; then
|
|
||||||
(
|
|
||||||
cd "$sub" && (
|
|
||||||
# the strange magic number is a hardcoded "empty tree" commit sha
|
|
||||||
get_renames "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
done < <(git submodule | awk '{print $2}')
|
|
||||||
git log --name-status --ignore-submodules=all "$base" "$sha" | grep -E "^R" | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}'
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "::group::changed-files"
|
echo "::group::changed-files"
|
||||||
|
|
||||||
echo "Resolving repository path..."
|
echo "Resolving repository path..."
|
||||||
@ -78,7 +60,6 @@ if [[ -z "$INPUT_FILES_PATTERN_FILE" ]]; then
|
|||||||
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_OLD_NEW_RENAMED_FILES=$(get_renames "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" | awk -v d="$INPUT_OLD_NEW_FILES_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
||||||
else
|
else
|
||||||
ADDED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" A | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ADDED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" A | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
COPIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" C | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
COPIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" C | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
@ -91,7 +72,6 @@ else
|
|||||||
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED_AND_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "*ACDMRTUX" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_MODIFIED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMRD" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
ALL_OLD_NEW_RENAMED_FILES=$(get_renames "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" | grep -x -E -f "$INPUT_FILES_PATTERN_FILE" | awk -v d="$INPUT_OLD_NEW_FILES_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
||||||
|
|
||||||
ALL_OTHER_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
ALL_OTHER_CHANGED=$(get_diff "$INPUT_PREVIOUS_SHA" "$INPUT_CURRENT_SHA" "ACMR" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
||||||
@ -209,7 +189,6 @@ echo "Unknown files: $UNKNOWN"
|
|||||||
echo "All changed and modified files: $ALL_CHANGED_AND_MODIFIED"
|
echo "All changed and modified files: $ALL_CHANGED_AND_MODIFIED"
|
||||||
echo "All changed files: $ALL_CHANGED"
|
echo "All changed files: $ALL_CHANGED"
|
||||||
echo "All modified files: $ALL_MODIFIED"
|
echo "All modified files: $ALL_MODIFIED"
|
||||||
echo "All old & new renamed files: $ALL_OLD_NEW_RENAMED_FILES"
|
|
||||||
|
|
||||||
echo "::set-output name=added_files::$ADDED"
|
echo "::set-output name=added_files::$ADDED"
|
||||||
echo "::set-output name=copied_files::$COPIED"
|
echo "::set-output name=copied_files::$COPIED"
|
||||||
@ -222,6 +201,5 @@ echo "::set-output name=unknown_files::$UNKNOWN"
|
|||||||
echo "::set-output name=all_changed_and_modified_files::$ALL_CHANGED_AND_MODIFIED"
|
echo "::set-output name=all_changed_and_modified_files::$ALL_CHANGED_AND_MODIFIED"
|
||||||
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
||||||
echo "::set-output name=all_modified_files::$ALL_MODIFIED"
|
echo "::set-output name=all_modified_files::$ALL_MODIFIED"
|
||||||
echo "::set-output name=all_old_new_renamed_files::$ALL_OLD_NEW_RENAMED_FILES"
|
|
||||||
|
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
@ -1 +0,0 @@
|
|||||||
This is a test file.
|
|
@ -1 +0,0 @@
|
|||||||
This is a test file.
|
|
Loading…
x
Reference in New Issue
Block a user