feat: Add support for non ascii filenames (#473)

* feat: Add support for non ascii filenames

Closes: #437

* Update action.yml

* Update README.md

* Create test-è.txt

* Update test.yml

* Update README.md

* Update action.yml

* Update entrypoint.sh

* Update entrypoint.sh

* Update entrypoint.sh
This commit is contained in:
Tonye Jack 2022-04-28 02:08:15 -04:00 committed by GitHub
parent 059617dc0d
commit a6d456f542
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 0 deletions

View file

@ -231,6 +231,16 @@ jobs:
echo "Your README.md has been modified ${{ steps.changed-files.outputs.modified_files }}."
shell:
bash
- name: Run changed-files with quotepath disabled
id: changed-files-quotepath
uses: ./
with:
quotepath: "false"
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-quotepath.outputs) }}'
shell:
bash
- name: Run changed-files with forward slash separator
id: changed-files-forward-slash
uses: ./

View file

@ -140,6 +140,7 @@ Support this project with a :star:
| 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` |
| 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` |
## Example

View file

@ -53,6 +53,10 @@ inputs:
description: 'Finds best common ancestor between two commits to use in a three-way merge as the base_sha'
default: 'false'
required: false
quotepath:
description: 'Output filenames completely verbatim by setting this to false'
default: 'true'
required: false
outputs:
added_files:
@ -177,6 +181,7 @@ runs:
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 }}
INPUT_QUOTEPATH: ${{ inputs.quotepath }}
branding:
icon: file-text

View file

@ -6,6 +6,12 @@ INPUT_SEPARATOR="${INPUT_SEPARATOR//'%'/'%25'}"
INPUT_SEPARATOR="${INPUT_SEPARATOR//$'\n'/'%0A'}"
INPUT_SEPARATOR="${INPUT_SEPARATOR//$'\r'/'%0D'}"
if [[ $INPUT_QUOTEPATH == "false" ]]; then
git config --global core.quotepath off
else
git config --global core.quotepath on
fi
function get_diff() {
base="$1"
sha="$2"

1
test/test-è.txt Normal file
View file

@ -0,0 +1 @@
This is a test file.