actions / runner-container-hooks

Runner Container Hooks for GitHub Actions
MIT License
67 stars 43 forks source link

k8s: handle $ symbols in environment variable names and values #74

Closed aibaars closed 1 year ago

aibaars commented 1 year ago

Previously, environment variables like:

env:
    LD_PRELOAD: /__w/_tool/CodeQL/2.12.6-20230403/x64/codeql/tools/linux64/${LIB}_${PLATFORM}_trace.so    

would wrongly get expanded by the shell when running a job via the k8s scripts. This may lead to errors like:

ERROR: ld.so: object '/__w/_tool/CodeQL/2.12.6-20230403/x64/codeql/tools/linux64/__trace.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

See a complete log for context: https://github.com/matihost/monorepo/actions/runs/4638170156/jobs/8207744339

This pull request:

This behaviour is the same as other special shell characters such as ' and ".