Skip to content

Commit 0874344

Browse files
feat: add support for returning posix path separator on windows (#2056)
Co-authored-by: GitHub Action <action@github.com>
1 parent 9f8300f commit 0874344

13 files changed

+11658
-238
lines changed

.github/workflows/test.yml

+35-2
Original file line numberDiff line numberDiff line change
@@ -1009,16 +1009,19 @@ jobs:
10091009
bash
10101010
test-dir-names-deleted-files-include-only-deleted-dirs-directory:
10111011
name: Test dir names deleted files include only deleted dirs
1012-
runs-on: ubuntu-latest
1012+
runs-on: ${{ matrix.platform }}
10131013
needs: build
1014+
strategy:
1015+
matrix:
1016+
platform: [ubuntu-latest, macos-latest, windows-latest]
10141017
if: needs.build.outputs.files_changed != 'true'
10151018
permissions:
10161019
contents: read
10171020
steps:
10181021
- name: Checkout branch
10191022
uses: actions/checkout@v4
10201023
with:
1021-
ref: cd1e384723e4d1a184568182ac2b27c53ebf017f
1024+
ref: ${{ github.event.pull_request.head.sha }}
10221025
repository: ${{ github.event.pull_request.head.repo.full_name }}
10231026
submodules: true
10241027
fetch-depth: 2
@@ -1030,6 +1033,7 @@ jobs:
10301033
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
10311034
dir_names: true
10321035
dir_names_deleted_files_include_only_deleted_dirs: true
1036+
fetch_depth: 60000
10331037
- name: Show output
10341038
run: |
10351039
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}'
@@ -1049,6 +1053,35 @@ jobs:
10491053
exit 1
10501054
shell:
10511055
bash
1056+
- name: Run changed-files with dir_names and dir_names_deleted_files_include_only_deleted_dirs with the test directory deleted returns posix path separator
1057+
id: changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator
1058+
uses: ./
1059+
with:
1060+
base_sha: a52f8621d26d5d9f54b80f74bda2d9eedff94693
1061+
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
1062+
dir_names: true
1063+
dir_names_deleted_files_include_only_deleted_dirs: true
1064+
use_posix_path_separator: true
1065+
fetch_depth: 60000
1066+
- name: Show output
1067+
run: |
1068+
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs) }}'
1069+
shell:
1070+
bash
1071+
- name: Check deleted_files output on non windows platform
1072+
if: steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files != 'test/test3' && runner.os != 'Windows'
1073+
run: |
1074+
echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})"
1075+
exit 1
1076+
shell:
1077+
bash
1078+
- name: Check deleted_files output on windows platform
1079+
if: "!contains(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files, 'test/test3') && runner.os == 'Windows'"
1080+
run: |
1081+
echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})"
1082+
exit 1
1083+
shell:
1084+
bash
10521085

10531086
test-since-last-remote-commit:
10541087
name: Test changed-files since last remote commit

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ inputs:
231231
description: "Maximum number of retries to fetch missing history."
232232
required: false
233233
default: "10"
234+
use_posix_path_separator:
235+
description: "Use POSIX path separator `/` for output filenames."
236+
required: false
237+
default: "false"
234238

235239
outputs:
236240
added_files:

0 commit comments

Comments
 (0)