Skip to content

Commit 01ecaae

Browse files
authored
fix: job hook scripts pre-emptively expands shell parameters (#686)
The `job_started_script` and `job_completed_script` pre-emptively expand any shell parameters defined in them, resulting in them being expanded when the `/opt/runner/job_started_script.sh` and `/opt/runner/job_completed_script.sh` files are created and not at runtime of the job. Instructing the heredoc document to skip expanding any shell parameters gives the expected functionality without having to escape them in the config file.
2 parents e9a7d28 + 0947e6c commit 01ecaae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runner_manager/bin/startup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ function setup_runner {
144144
sudo -H -u actions bash -c "nohup /home/actions/actions-runner/run.sh --jitconfig \"${JIT_CONFIG}\" 2>/home/actions/actions-runner/logs &"
145145
fi
146146

147-
cat <<EOF >/opt/runner/job_started_script.sh
147+
cat <<'EOF' >/opt/runner/job_started_script.sh
148148
${RUNNER_JOB_STARTED_SCRIPT}
149149
EOF
150150

151-
cat <<EOF >/opt/runner/job_completed_script.sh
151+
cat <<'EOF' >/opt/runner/job_completed_script.sh
152152
${RUNNER_JOB_COMPLETED_SCRIPT}
153153
EOF
154154

0 commit comments

Comments
 (0)