Skip to content

Commit 8836370

Browse files
authored
fix(ci): resolve new zizmor findings (#217)
zizmor v1.25.0 (bumped by Dependabot) now flags `${{ inputs.* }}` expressions used directly in `run:` blocks of composite actions as template-injection risks (attacker-controllable code expansion). **Fix**: Move all `${{ inputs.* }}` references in `action.yml` to `env:` blocks and reference them as shell variables (`${VAR}`) in the `run:` scripts. This is the standard mitigation — environment variables are not subject to expression-context injection. Affected lines: 46, 52, 55-59, 61-64, 73-74, 80 (17 findings total, all resolved).
2 parents 456131e + fa0aca1 commit 8836370

1 file changed

Lines changed: 26 additions & 14 deletions

File tree

action.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,41 +43,53 @@ runs:
4343
steps:
4444
- name: Install aimock
4545
shell: bash
46-
run: npm install -g @copilotkit/aimock@${{ inputs.version }}
46+
env:
47+
AIMOCK_VERSION: ${{ inputs.version }}
48+
run: npm install -g "@copilotkit/aimock@${AIMOCK_VERSION}"
4749

4850
- name: Start aimock
4951
id: start
5052
shell: bash
53+
env:
54+
AIMOCK_HOST: ${{ inputs.host }}
55+
AIMOCK_PORT: ${{ inputs.port }}
56+
AIMOCK_CONFIG: ${{ inputs.config }}
57+
AIMOCK_FIXTURES: ${{ inputs.fixtures }}
58+
AIMOCK_ARGS: ${{ inputs.args }}
5159
run: |
52-
URL="http://${{ inputs.host }}:${{ inputs.port }}"
60+
URL="http://${AIMOCK_HOST}:${AIMOCK_PORT}"
5361
echo "url=${URL}" >> $GITHUB_OUTPUT
5462
55-
if [ -n "${{ inputs.config }}" ]; then
56-
aimock --config "${{ inputs.config }}" \
57-
--port ${{ inputs.port }} \
58-
--host ${{ inputs.host }} \
59-
${{ inputs.args }} &
63+
if [ -n "${AIMOCK_CONFIG}" ]; then
64+
aimock --config "${AIMOCK_CONFIG}" \
65+
--port "${AIMOCK_PORT}" \
66+
--host "${AIMOCK_HOST}" \
67+
${AIMOCK_ARGS} &
6068
else
61-
aimock --fixtures "${{ inputs.fixtures }}" \
62-
--port ${{ inputs.port }} \
63-
--host ${{ inputs.host }} \
64-
${{ inputs.args }} &
69+
aimock --fixtures "${AIMOCK_FIXTURES}" \
70+
--port "${AIMOCK_PORT}" \
71+
--host "${AIMOCK_HOST}" \
72+
${AIMOCK_ARGS} &
6573
fi
6674
6775
echo $! > /tmp/aimock.pid
6876
echo "Started aimock (PID: $(cat /tmp/aimock.pid))"
6977
7078
- name: Wait for health check
7179
shell: bash
80+
env:
81+
AIMOCK_HOST: ${{ inputs.host }}
82+
AIMOCK_PORT: ${{ inputs.port }}
83+
AIMOCK_TIMEOUT: ${{ inputs.wait-timeout }}
7284
run: |
73-
URL="http://${{ inputs.host }}:${{ inputs.port }}/health"
74-
TIMEOUT=${{ inputs.wait-timeout }}
85+
URL="http://${AIMOCK_HOST}:${AIMOCK_PORT}/health"
86+
TIMEOUT="${AIMOCK_TIMEOUT}"
7587
ELAPSED=0
7688
7789
echo "Waiting for ${URL} ..."
7890
while [ $ELAPSED -lt $TIMEOUT ]; do
7991
if curl -sf "$URL" > /dev/null 2>&1; then
80-
echo "aimock is ready at http://${{ inputs.host }}:${{ inputs.port }}"
92+
echo "aimock is ready at http://${AIMOCK_HOST}:${AIMOCK_PORT}"
8193
exit 0
8294
fi
8395
sleep 1

0 commit comments

Comments
 (0)