Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for returning posix path separator on windows #2056

Merged
merged 9 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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