Skip to content

run.sh / run-helper.sh.template uses "$*" instead of "$@" #4127

@kratsg

Description

@kratsg

Describe the bug

run.sh has lines like

        "$DIR"/run-helper.sh $* &

and the run-helper.sh.template has lines like

"$DIR"/bin/Runner.Listener run $*

In both of these files, they assume that anything passed is a single string/line instead of an array. Additionally, it's not quoted. If one does

command: ["/home/runner/run.sh", "a", "b", "c d"]

such as in a kubernetes/self-hosted set up, you will have issues with passing them through to the nested command inside the helper template.

Expected behavior

I suspect one needs to be using "$@" safely to properly pass arguments through, but also not entirely clear how one expects to pass arguments through to the nested template unless one expects end users to modify it?

Runner Version and Platform

RUNNER_VERSION=2.329.0

OS of the machine running the runner? OSX/Windows/Linux/...

Linux, Almalinux9

What's not working?

runner@a8fd96b82a62:~$ /home/runner/run.sh --name "FAKE NAME"
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known directory 'Bin': '/home/runner/bin'
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known directory 'Root': '/home/runner'
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known config file 'Credentials': '/home/runner/.credentials'
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known directory 'Bin': '/home/runner/bin'
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known directory 'Root': '/home/runner'
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known config file 'Runner': '/home/runner/.runner'
[RUNNER 2025-11-20 21:35:17Z INFO Listener] Runner is built for Linux (X64) - linux-x64.
[RUNNER 2025-11-20 21:35:17Z INFO Listener] RuntimeInformation: Ubuntu 22.04.5 LTS.
[RUNNER 2025-11-20 21:35:17Z INFO Listener] Version: 2.330.0
[RUNNER 2025-11-20 21:35:17Z INFO Listener] Commit: e2088f1fc730f9e857bec485223b090ef0e3cb87
[RUNNER 2025-11-20 21:35:17Z INFO Listener] Culture:
[RUNNER 2025-11-20 21:35:17Z INFO Listener] UI Culture:
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known directory 'Bin': '/home/runner/bin'
[RUNNER 2025-11-20 21:35:17Z INFO HostContext] Well known directory 'Root': '/home/runner'
[RUNNER 2025-11-20 21:35:17Z INFO Listener] Validating directory permissions for: '/home/runner'
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] Parse
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] Parsing 4 args
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] parsing argument
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] HasArgs: False
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] Adding Command: run
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] parsing argument
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] HasArgs: True
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] arg: name
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] parsing argument
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] HasArgs: True
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] Adding option 'name': 'FAKE'
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] parsing argument
[RUNNER 2025-11-20 21:35:17Z INFO CommandLineParser] HasArgs: True
[RUNNER 2025-11-20 21:35:17Z INFO Listener] Arguments parsed

compare to

runner@a8fd96b82a62:~$ .//bin/Runner.Listener --name "FAKE NAME"
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known directory 'Bin': '/home/runner/bin'
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known directory 'Root': '/home/runner'
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known config file 'Credentials': '/home/runner/.credentials'
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known directory 'Bin': '/home/runner/bin'
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known directory 'Root': '/home/runner'
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known config file 'Runner': '/home/runner/.runner'
[RUNNER 2025-11-20 21:35:55Z INFO Listener] Runner is built for Linux (X64) - linux-x64.
[RUNNER 2025-11-20 21:35:55Z INFO Listener] RuntimeInformation: Ubuntu 22.04.5 LTS.
[RUNNER 2025-11-20 21:35:55Z INFO Listener] Version: 2.330.0
[RUNNER 2025-11-20 21:35:55Z INFO Listener] Commit: e2088f1fc730f9e857bec485223b090ef0e3cb87
[RUNNER 2025-11-20 21:35:55Z INFO Listener] Culture:
[RUNNER 2025-11-20 21:35:55Z INFO Listener] UI Culture:
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known directory 'Bin': '/home/runner/bin'
[RUNNER 2025-11-20 21:35:55Z INFO HostContext] Well known directory 'Root': '/home/runner'
[RUNNER 2025-11-20 21:35:55Z INFO Listener] Validating directory permissions for: '/home/runner'
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] Parse
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] Parsing 2 args
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] parsing argument
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] HasArgs: True
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] arg: name
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] parsing argument
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] HasArgs: True
[RUNNER 2025-11-20 21:35:55Z INFO CommandLineParser] Adding option 'name': 'FAKE NAME'
[RUNNER 2025-11-20 21:35:55Z INFO Listener] Arguments parsed
[RUNNER 2025-11-20 21:35:55Z INFO Runner] ExecuteCommand

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions