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

run command's arguments split before a period on Windows #231

Closed
ppalaga opened this issue Nov 26, 2019 · 3 comments
Closed

run command's arguments split before a period on Windows #231

ppalaga opened this issue Nov 26, 2019 · 3 comments
Labels
bug Something isn't working external

Comments

@ppalaga
Copy link

ppalaga commented Nov 26, 2019

I hope this is the right place to report this issue.

Having a maven.yml like the following:

name: Java CI

on: [pull_request]

jobs:
  windows:
    runs-on: windows-2019
    steps:
    - uses: actions/checkout@v1
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Build with Maven
      run: ./mvnw clean verify -B -ntp -Dinvoker.streamLogs=true

results in the following Maven error

[ERROR] Unknown lifecycle phase ".streamLogs=true". You must specify a valid lifecycle phase or a goal

which means that GitHub Actions parse the arguments of mvnw command in a wrong way. Apparently, period . is interpreted as a delimiter and thus 6 args

1 clean
2 verify
3 -B
4 -ntp
5 -Dinvoker
6 .streamLogs=true

are passed instead of 5:

1 clean
2 verify
3 -B
4 -ntp
5 -Dinvoker.streamLogs=true

This happens only on Windows. The same command works as expected in Linux.

Workaround: enclosing the whole command in apostrophes and the comma containing arg in double quoutes helps:

      run: './mvnw clean verify -B -ntp "-Dinvoker.streamLogs=true"'
@ppalaga ppalaga added the bug Something isn't working label Nov 26, 2019
@ericsciple
Copy link
Contributor

@ppalaga this appears to be a behavior of pwsh/powershell which is the default shell used on windows

another solution might be to try:

- shell: cmd
  run: .\mvnw clean verify -B -ntp "-Dinvoker.streamLogs=true"

@ericsciple
Copy link
Contributor

@bryanmacfarlane is https://github.saobby.my.eu.orgmunity/t5/GitHub-Actions/bd-p/actions a better place for non-toolkit related question? should we update the issue template?

@ppalaga
Copy link
Author

ppalaga commented Dec 3, 2019

@ericsciple thanks for the explanation! If powershell is really the the default shell and its handling of period is well known and documented, I think the described behavior is expected and this issue can be closed.

@ppalaga ppalaga closed this as completed Dec 3, 2019
planetf1 added a commit to planetf1/egeria that referenced this issue Feb 25, 2021
Signed-off-by: Nigel Jones <nigel.l.jones+git@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external
Projects
None yet
Development

No branches or pull requests

2 participants