chore(ci): route build_agent_package version/dist/path through env: for hardening uniformity#1613
Conversation
agent_id was already hardened via env:; version, dist, and path were
still interpolated as raw ${{ }} expressions inside run: blocks. Route
all three through env: in the publish step, and read the pyproject.toml
version via a here-doc with os.environ["PATHV"] so no shell variable is
embedded in the Python source string. No behavior change.
Closes #1611
SummaryClean, correctly-scoped CI hardening — every dynamic value in Issues FoundNone blocking. 🟢 Minor — Strengths
VerdictApprove — no blocking issues; the change is correct, behavior-preserving, and verified live. Safe to merge. |
Why this matters
build_agent_package.ymlalready routes the user-suppliedagent_idthroughenv:before any shell, butversion,dist, andpathwere still interpolated as raw${{ … }}expressions insiderun:blocks, and the version read embedded a shell var inside apython -ccode string. The injection risk today is nil — those values are workflow/repo-controlled, not user input — but applying theenv:convention uniformly makes the hardening obvious so a future copy-paste onto a path that does carry user input can't silently reintroduce a real injection.No behavior change. Verified live on the real runner: a
workflow_dispatchof the hardened workflow on this branch produced the identicalagent-pkg-email-v0.1.0prerelease (wheel + sdist), green end-to-end.Test plan
actionlintclean onbuild_agent_package.yml(only a pre-existingSC2129style note, unchanged by this PR)yaml.safe_load)${{ … }}remains in anyrun:block — every dynamic value (agent_id,version,dist,path) now reaches the shell/Python viaenv:; the version read uses a here-doc readingos.environ["PATHV"]workflow_dispatchon this branch → green run, identicalagent-pkg-email-v0.1.0prerelease with.whl+.tar.gz(run)curlof both release assets → HTTP 200; clean-venvpip installof the wheel +import gaia_agent_emailworksFull post-merge verification evidence (all 8 ACs) is captured in #1602.
Closes #1611
Related: #1598, #1601, #1602