Docker and K8s: Fix shell arguments when split by the runner#115
Merged
nikola-jokic merged 2 commits intomainfrom Nov 20, 2023
Merged
Docker and K8s: Fix shell arguments when split by the runner#115nikola-jokic merged 2 commits intomainfrom
nikola-jokic merged 2 commits intomainfrom
Conversation
fhammerl
reviewed
Nov 10, 2023
| } | ||
|
|
||
| export function fixArgs(args: string[]): string[] { | ||
| return shlex.split(args.join(' ')) |
Contributor
There was a problem hiding this comment.
Is powershell ok with this?
Collaborator
Author
There was a problem hiding this comment.
If arguments are not POSIX complaint, adding quotes around them would fix the problem
cc019aa to
887f455
Compare
|
@nikola-jokic : does this cover the same as described in #117? |
Collaborator
Author
|
Hey @timmjd, Yes! Your solution helped fix one problem in case the quotes are broken. This is the problem I was fixing for docker, I just extended it to be the same for k8s. Thank you for raising it, by the way! |
|
Awesome! This implementation is even better than #117 due to you keep the array consistency. Example 1name: Build MKDocs
runs:
using: docker
image: docker://squidfunk/mkdocs-material:latest
entrypoint: mkdocs
args:
- build --verbose --strictspec:
containers:
- command:
- mkdocs
args:
- build --verbose --strictExample 2name: Build MKDocs
runs:
using: docker
image: docker://squidfunk/mkdocs-material:latest
entrypoint: mkdocs
args:
- build
- --verbose
- --strictspec:
containers:
- command:
- mkdocs
args:
- build
- --verbose
- --strict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When runner passes arguments to the hook, there may be situations where quoted strings are interpreted as separate arguments.
This PR addresses the issue and fixes the arguments based on
shlexexpansionFixes the issue in this discussion