Skip to content

Commit 5c28491

Browse files
committed
Fix Windows path conversion in .envrc creation
Convert Windows-style paths from setup-java outputs to Unix paths using cygpath. The setup-java action returns Windows paths like 'C:\hostedtoolcache\...' on Windows, which need to be converted to Unix-style paths '/c/hostedtoolcache/...' for bash scripts. Changes: - Add conditional cygpath conversion for Windows runner - Convert JAVA8_PATH, JAVA11_PATH, JAVA17_PATH on Windows only - Leave paths unchanged on Linux and macOS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Introduced in the course of support-and-care/maven-support-and-care#137
1 parent c5e5708 commit 5c28491

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ jobs:
7979
JAVA11_PATH: ${{ steps.setup-jdk11.outputs.path }}
8080
JAVA17_PATH: ${{ steps.setup-jdk17.outputs.path }}
8181
run: |
82+
# Convert Windows paths to Unix paths if on Windows
83+
if [[ "$RUNNER_OS" == "Windows" ]]; then
84+
JAVA8_PATH="$(cygpath -u "$JAVA8_PATH")"
85+
JAVA11_PATH="$(cygpath -u "$JAVA11_PATH")"
86+
JAVA17_PATH="$(cygpath -u "$JAVA17_PATH")"
87+
fi
88+
8289
cat > .envrc << EOF
8390
# Environment configuration for Java 9 Jigsaw Examples
8491
# Auto-generated by GitHub Actions

0 commit comments

Comments
 (0)