Skip to content

Commit f11123d

Browse files
committed
ci(security): harden workflow steps against template-injection
zizmor v1.24.1 reports 8 template-injection findings across three workflow files where GitHub Actions ${{ ... }} expressions are interpolated directly into shell run: blocks. Applies the canonical fix pattern: hoist every dynamic value into a step-level env: block and reference it as a shell variable ("${VAR}") from the script. Files changed: - control-ui-locale-refresh.yml: move matrix.locale into env as LOCALE (1 site) - docker-release.yml: hoist steps.tags.outputs.{value,slim} plus the four needs.build-{amd64,arm64}.outputs.{digest,slim-digest} values into env for both manifest-creation steps (6 sites) - openclaw-npm-release.yml: hoist steps.publish_tarball.outputs.path into env as PUBLISH_TARBALL_PATH in the Publish step (1 site) Verified locally with zizmor --persona regular on the three files: 'No findings to report. Good job!'. pnpm format:check and pnpm lint pass. Refs #68428. Complements #66884, which covers the remaining 12 sites in openclaw-cross-os-release-checks-reusable.yml.
1 parent 18c4fd5 commit f11123d

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/control-ui-locale-refresh.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ jobs:
140140
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
141141
OPENCLAW_CONTROL_UI_I18N_MODEL: gpt-5.4
142142
OPENCLAW_CONTROL_UI_I18N_THINKING: low
143-
run: node --import tsx scripts/control-ui-i18n.ts sync --locale "${{ matrix.locale }}" --write
143+
LOCALE: ${{ matrix.locale }}
144+
run: node --import tsx scripts/control-ui-i18n.ts sync --locale "${LOCALE}" --write
144145

145146
- name: Commit and push locale updates
146147
env:

.github/workflows/docker-release.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,28 +362,36 @@ jobs:
362362
363363
- name: Create and push default manifest
364364
shell: bash
365+
env:
366+
TAGS: ${{ steps.tags.outputs.value }}
367+
AMD64_DIGEST: ${{ needs.build-amd64.outputs.digest }}
368+
ARM64_DIGEST: ${{ needs.build-arm64.outputs.digest }}
365369
run: |
366370
set -euo pipefail
367-
mapfile -t tags <<< "${{ steps.tags.outputs.value }}"
371+
mapfile -t tags <<< "${TAGS}"
368372
args=()
369373
for tag in "${tags[@]}"; do
370374
[ -z "$tag" ] && continue
371375
args+=("-t" "$tag")
372376
done
373377
docker buildx imagetools create "${args[@]}" \
374-
${{ needs.build-amd64.outputs.digest }} \
375-
${{ needs.build-arm64.outputs.digest }}
378+
"${AMD64_DIGEST}" \
379+
"${ARM64_DIGEST}"
376380
377381
- name: Create and push slim manifest
378382
shell: bash
383+
env:
384+
SLIM_TAGS: ${{ steps.tags.outputs.slim }}
385+
AMD64_SLIM_DIGEST: ${{ needs.build-amd64.outputs.slim-digest }}
386+
ARM64_SLIM_DIGEST: ${{ needs.build-arm64.outputs.slim-digest }}
379387
run: |
380388
set -euo pipefail
381-
mapfile -t tags <<< "${{ steps.tags.outputs.slim }}"
389+
mapfile -t tags <<< "${SLIM_TAGS}"
382390
args=()
383391
for tag in "${tags[@]}"; do
384392
[ -z "$tag" ] && continue
385393
args+=("-t" "$tag")
386394
done
387395
docker buildx imagetools create "${args[@]}" \
388-
${{ needs.build-amd64.outputs.slim-digest }} \
389-
${{ needs.build-arm64.outputs.slim-digest }}
396+
"${AMD64_SLIM_DIGEST}" \
397+
"${ARM64_SLIM_DIGEST}"

.github/workflows/openclaw-npm-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,10 @@ jobs:
397397
env:
398398
OPENCLAW_PREPACK_PREPARED: "1"
399399
OPENCLAW_NPM_PUBLISH_TAG: ${{ inputs.npm_dist_tag }}
400+
PUBLISH_TARBALL_PATH: ${{ steps.publish_tarball.outputs.path }}
400401
run: |
401402
set -euo pipefail
402-
publish_target="${{ steps.publish_tarball.outputs.path }}"
403+
publish_target="${PUBLISH_TARBALL_PATH}"
403404
if [[ -n "${publish_target}" ]]; then
404405
publish_target="./${publish_target}"
405406
fi

0 commit comments

Comments
 (0)