3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-16 19:27:39 +00:00

feat: add support for configuring diff.relative (#515)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Tonye Jack 2022-06-02 12:13:45 -04:00 committed by GitHub
parent 3ea81e414c
commit 3538a9c448
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -144,6 +144,7 @@ Support this project with a :star:
| since\_last\_remote\_commit | `boolean` | `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 | `boolean` | `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 | `boolean` | `false` | `true` | Output filenames completely verbatim by setting this to `false` |
| diff_relative | `boolean` | `false` | `` | Exclude changes outside the current directory and show pathnames relative to it. |
## Examples

View file

@ -70,6 +70,9 @@ inputs:
description: 'Output filenames completely verbatim by setting this to false'
default: 'true'
required: false
diff_relative:
description: 'Exclude changes outside the current directory and show pathnames relative to it'
required: false
outputs:
added_files:
@ -203,6 +206,7 @@ runs:
INPUT_INCLUDE_ALL_OLD_NEW_RENAMED_FILES: ${{ inputs.include_all_old_new_renamed_files }}
INPUT_OLD_NEW_SEPARATOR: ${{ inputs.old_new_separator }}
INPUT_OLD_NEW_FILES_SEPARATOR: ${{ inputs.old_new_files_separator }}
INPUT_DIFF_RELATIVE: ${{ inputs.diff_relative }}
branding:
icon: file-text

View file

@ -12,6 +12,10 @@ else
git config --global core.quotepath on
fi
if [[ -n $INPUT_DIFF_RELATIVE ]]; then
git config --global diff.relative "$INPUT_DIFF_RELATIVE"
fi
function get_diff() {
base="$1"
sha="$2"