Skip to content

Comments

Add inline security comments to extra-args validation in setup-python-env action#45

Merged
pmalarme merged 2 commits intofeature/add-documentation-and-copilot-instructionsfrom
copilot/sub-pr-18-another-one
Feb 19, 2026
Merged

Add inline security comments to extra-args validation in setup-python-env action#45
pmalarme merged 2 commits intofeature/add-documentation-and-copilot-instructionsfrom
copilot/sub-pr-18-another-one

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

The extra-args validation loop in the composite action lacked comments explaining its security intent, and the shellcheck disable directive didn't reference the validation—making the connection between the two implicit and fragile.

Changes

  • .github/actions/setup-python-env/action.yml
    • Added comment inside validation block stating the token validation intent
    • Added NOTE documenting that -- (end-of-options marker) is intentionally permitted by the regex; any following positional args would fail validation
    • Updated shellcheck disable=SC2086 comment to include "all tokens validated above", explicitly tying the validation loop to the uv sync call
if [[ -n "$EXTRA_ARGS" ]]; then
  # Validate each whitespace-split token: must start with '-' and contain only safe flag characters.
  # NOTE: '--' (end-of-options marker) is intentionally allowed; positional args would fail validation.
  for arg in $EXTRA_ARGS; do
    if [[ ! "$arg" =~ ^-[a-zA-Z0-9=._:/@+-]+$ ]]; then
      echo "::error::Unsafe extra-args token: '$arg'. Each token must start with '-' and contain only safe flag characters." >&2
      exit 1
    fi
  done
fi
# shellcheck disable=SC2086  # intentional word-splitting for uv flags (all tokens validated above)
uv sync $args $EXTRA_ARGS

Testing

  • Not run (why?)
  • uv run poe check
  • Other: comment-only change; no functional logic altered

Checklist

  • Linked issue or task reference
  • Added/updated tests where relevant
  • Updated docs/README if needed
  • No secrets or sensitive data added
  • Considered backward compatibility and deployment impact

Additional context


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…tion

Co-authored-by: pmalarme <686568+pmalarme@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation and copilot instructions based on feedback Add inline security comments to extra-args validation in setup-python-env action Feb 19, 2026
Copilot AI requested a review from pmalarme February 19, 2026 14:55
@pmalarme pmalarme marked this pull request as ready for review February 19, 2026 15:12
@pmalarme pmalarme merged commit 263494e into feature/add-documentation-and-copilot-instructions Feb 19, 2026
@pmalarme pmalarme deleted the copilot/sub-pr-18-another-one branch February 19, 2026 15:12
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.

2 participants