Skip to content

CICD-188 · Guard logged configuration values ​

Encyclopedia · Workflow security fundamentals · All snippets

Previous · CICD-187 · Next · CICD-189

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites trusted repository, verified inputs and read-only default access.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters DEPLOY_TARGET, DEPLOY_TOKEN.

2. Copy the snippet ​

bash
printf 'deploy_target=%s\n' "${DEPLOY_TARGET:?}"
test -n "${DEPLOY_TOKEN:?}"

3. How it works ​

The command archives or inspects the selected files. Verify the relative paths and file set before using the archive downstream. The shell predicate makes the expected state explicit and returns a nonzero status when it is not satisfied.

4. Verify the result ​

Log the non-secret target only. Disable shell tracing in secret-bearing steps.

Watch for. Use the intended trusted execution context. Keep secret values out of traces, artifacts and debug output.

Validation syntax-validated (Bash parse). Status definitions.