From 6ed7632824d235029086612d4330d659005af687 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 12 May 2024 12:50:52 -0600 Subject: [PATCH] fix: bug resolving windows paths (#426) * fix: bug resolving windows paths * Update test.yml --- .github/workflows/test.yml | 6 ++++-- entrypoint.sh | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de8a1e0..bdedcdf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -175,6 +175,8 @@ jobs: - name: Test deletion of test/new.txt uses: ./ + with: + path: test id: deleted_file_test - name: Show output @@ -182,12 +184,12 @@ jobs: echo "Changed files: ${{ steps.deleted_file_test.outputs.changed_files }}" - name: Display deleted file test result - if: "contains(steps.deleted_file_test.outputs.changed_files, 'test/new.txt')" + if: "contains(steps.deleted_file_test.outputs.changed_files, 'new.txt')" run: | echo "Deletion detected: ${{ steps.deleted_file_test.outputs.changed_files }}" - name: Verify Deletion of test/new.txt - if: "!contains(steps.deleted_file_test.outputs.changed_files, 'test/new.txt')" + if: "!contains(steps.deleted_file_test.outputs.changed_files, 'new.txt')" run: | echo "No Deletion detected: (Not expected)" exit 1 diff --git a/entrypoint.sh b/entrypoint.sh index 2c66d12..fa1931e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,8 +12,14 @@ echo "::debug::Separator: $INPUT_SEPARATOR" git config --global core.quotepath "$INPUT_QUOTEPATH" +OS=$(uname -s) + if [[ -n $INPUT_PATH ]]; then - REPO_DIR="$GITHUB_WORKSPACE/$INPUT_PATH" + if [[ "$OS" == "NT"* ]] || [[ "$OS" == "MINGW"* ]] || [[ "$OS" == *"MSYS"* ]]; then + REPO_DIR="$GITHUB_WORKSPACE\\$INPUT_PATH" + else + REPO_DIR="$GITHUB_WORKSPACE/$INPUT_PATH" + fi echo "Resolving repository path: $REPO_DIR" if [[ ! -d "$REPO_DIR" ]]; then