Skip to content

Commit

Permalink
feat: add support for returning posix path separator on windows (#2056)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
jackton1 and actions-user authored Apr 18, 2024
1 parent 9f8300f commit 0874344
Show file tree
Hide file tree
Showing 13 changed files with 11,658 additions and 238 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1009,16 +1009,19 @@ jobs:
bash
test-dir-names-deleted-files-include-only-deleted-dirs-directory:
name: Test dir names deleted files include only deleted dirs
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform }}
needs: build
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: cd1e384723e4d1a184568182ac2b27c53ebf017f
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
fetch-depth: 2
Expand All @@ -1030,6 +1033,7 @@ jobs:
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
dir_names: true
dir_names_deleted_files_include_only_deleted_dirs: true
fetch_depth: 60000
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}'
Expand All @@ -1049,6 +1053,35 @@ jobs:
exit 1
shell:
bash
- 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
id: changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator
uses: ./
with:
base_sha: a52f8621d26d5d9f54b80f74bda2d9eedff94693
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
dir_names: true
dir_names_deleted_files_include_only_deleted_dirs: true
use_posix_path_separator: true
fetch_depth: 60000
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs) }}'
shell:
bash
- name: Check deleted_files output on non windows platform
if: steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files != 'test/test3' && runner.os != 'Windows'
run: |
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 }})"
exit 1
shell:
bash
- name: Check deleted_files output on windows platform
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'"
run: |
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 }})"
exit 1
shell:
bash

test-since-last-remote-commit:
name: Test changed-files since last remote commit
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ inputs:
description: "Maximum number of retries to fetch missing history."
required: false
default: "10"
use_posix_path_separator:
description: "Use POSIX path separator `/` for output filenames."
required: false
default: "false"

outputs:
added_files:
Expand Down
Loading

0 comments on commit 0874344

Please sign in to comment.