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

fix: simplify action quoting on Windows #1742

Closed
wants to merge 1 commit into from

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Jan 30, 2024

I'm not sure the quoting was necessary to make this complicated, I don't see a reason in #1346. This is option 1 to fix #1740. Would also close #1741, which is option 2 (personally, if option 1 doesn't work, option 3 seems better than option 2).

This is needed to support Powershell 7.4, which is beginning to ship on GHA.

The action is not exercised in tests, so we'll need someone to check it. I can later today, perhaps. (It seems to be in the tests, actually)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
Copy link
Contributor Author

Ahh, so the problem is that "" resolves to nothing, while '""' resolved to the empty string (pre-7.4), but now resolves to the string "". That's why the quoting was that way. Is there a recommended alternative to pass the empty string in powershell 7.3/7.4?

@henryiii
Copy link
Contributor Author

I don't understand what is eating those empty args. If I run powershell 7.4.1 on my Mac, I see python3 -c "import sys; print(sys.argv)" "" produces ['-c', ''], as I'd expect, and pipx passes them through correctly too. YAML shouldn't be eating them inside a block, so I'm not sure where they are going.

@henryiii
Copy link
Contributor Author

henryiii commented Jan 30, 2024

Ahh, I bet the runner we are using is old, and old runners have the older powershells. Yeah, that's it:

$PSNativeCommandArgumentPassing = 'Legacy'
PS /Users/henryschreiner/git> python3 -c "import sys; print(sys.argv)" ""
['-c']

Okay, that's a great change, and it's annoying for us until every runner (presumably including local ones) supports it.

@henryiii henryiii closed this Jan 30, 2024
@henryiii henryiii deleted the henryiii/fix/action2 branch June 6, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub Actions Windows: Invalid --only='""' (fixed in 2.16.5)
1 participant