Skip to content

Commit

Permalink
fix: job hook scripts pre-emptively expands shell parameters (#686)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tcarmet authored Oct 7, 2024
2 parents e9a7d28 + 0947e6c commit 01ecaae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runner_manager/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ function setup_runner {
sudo -H -u actions bash -c "nohup /home/actions/actions-runner/run.sh --jitconfig \"${JIT_CONFIG}\" 2>/home/actions/actions-runner/logs &"
fi

cat <<EOF >/opt/runner/job_started_script.sh
cat <<'EOF' >/opt/runner/job_started_script.sh
${RUNNER_JOB_STARTED_SCRIPT}
EOF

cat <<EOF >/opt/runner/job_completed_script.sh
cat <<'EOF' >/opt/runner/job_completed_script.sh
${RUNNER_JOB_COMPLETED_SCRIPT}
EOF

Expand Down

0 comments on commit 01ecaae

Please sign in to comment.