Skip to content

Comments

Validate agent names before Docker build in python-docker-build workflow#43

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

Validate agent names before Docker build in python-docker-build workflow#43
pmalarme merged 2 commits intofeature/add-documentation-and-copilot-instructionsfrom
copilot/sub-pr-18

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Summary

Agent names extracted from git diff output via cut -d/ -f2 were flowing unvalidated into Docker build arguments (-t, -f, path). On pull_request triggers from forks, a contributor could craft a directory name with characters invalid in Docker image tags or that confuse shell tooling (spaces, colons, uppercase, etc.).

Added an allowlist regex check in the detect job's agent-discovery loop:

if [[ ! "$agent" =~ ^[a-z0-9][a-z0-9_-]*$ ]]; then
  echo "::warning::Skipping agent with invalid name: '$agent'" >&2
  continue
fi

Names not matching ^[a-z0-9][a-z0-9_-]*$ are skipped with a workflow warning rather than passed to docker build.

Testing

  • Not run (why?)
  • uv run poe check
  • Other: CodeQL static analysis — 0 alerts

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pmalarme <686568+pmalarme@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on documentation and copilot instructions Validate agent names before Docker build in python-docker-build workflow Feb 19, 2026
Copilot AI requested a review from pmalarme February 19, 2026 14:56
@pmalarme pmalarme marked this pull request as ready for review February 19, 2026 15:11
@pmalarme pmalarme merged commit 6352048 into feature/add-documentation-and-copilot-instructions Feb 19, 2026
@pmalarme pmalarme deleted the copilot/sub-pr-18 branch February 19, 2026 15:11
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