fix: shell quote leak in release-go workflow target passing#969
Merged
Conversation
The workflow built args via string concatenation with literal single
quotes inside: args="$args --targets '${{ inputs.targets }}'".
Since $args was unquoted on invocation, bash didn't re-process the
quotes — they passed through as literal characters to argparse,
making the target name 'onboarding' (with quotes) instead of
onboarding.
Switch to bash array (ARGS+=) with proper "${ARGS[@]}" expansion
so values pass through cleanly. Also strip quote characters in the
Python filter_targets() as defense-in-depth, and remove duplicate
--force/--no-push checks in the workflow.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
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.
The workflow built args via string concatenation with literal single
quotes inside: args="$args --targets '${{ inputs.targets }}'".
Since $args was unquoted on invocation, bash didn't re-process the
quotes — they passed through as literal characters to argparse,
making the target name 'onboarding' (with quotes) instead of
onboarding.
Switch to bash array (ARGS+=) with proper "${ARGS[@]}" expansion
so values pass through cleanly. Also strip quote characters in the
Python filter_targets() as defense-in-depth, and remove duplicate
--force/--no-push checks in the workflow.
Fix shell quote leaking in release-go workflow target passing
The release-go workflow had a shell quoting issue where single quotes around the
--targetsinput value were being passed literally to the Python script instead of being interpreted as shell quoting. This caused target names to include stray quotes (e.g.,'target1,target2'), leading to target matching failures.Changes:
.github/workflows/release-go.yml: Replaced string concatenation (args="$args ...") with proper bash arrays (ARGS+=()) and array expansion ("${ARGS[@]}"), which correctly handles argument boundaries without quote leaking. Also removed duplicate--forceand--no-pushflag checks that were present in the original code.scripts/release-go.py: Added defensive.strip('\'"')when parsing the targets filter, stripping any leading/trailing single or double quotes from target names as a safety measure against quote leakage from any invocation method.