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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this patch may end up opening a can of worms because unquoted variable interpolation may turn into multiple arguments if it has spaces in it.
Have you checked such problematic scenarios? I'd very much like to be more confident with this...
Also, why not change this script to work the same way as other commands accepting
${INPUT_PACKAGES_DIR%%/}/*
?Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had a few tests on it.
For example, a path like
/github/workspace/dist package/
may fail all twine commands since there is a space in the path.Also, error like this will be displayed:
Because these arguments are not quoted:
gh-action-pypi-publish/twine-upload.sh
Lines 21 to 22 in 1bbe3c9
gh-action-pypi-publish/twine-upload.sh
Line 35 in 1bbe3c9
gh-action-pypi-publish/twine-upload.sh
Line 54 in 1bbe3c9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because
iterdir()
is used in the script so using${INPUT_PACKAGES_DIR%%/}/*
will result in NotADirectoryError.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that you wouldn't need to use
iterdir()
because the outer shell would resolve that into multiple arguments IIUC.