Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Disable interpolation of HEREDOC strings containing runner hook scripts #4333

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Peter-Sh
Copy link

@Peter-Sh Peter-Sh commented Jan 2, 2025

Interpolation was applied within the user-data.sh context, causing unexpected empty values for variables and other unintended effects.

While this behavior might be useful in certain cases, it requires consistently escaping everything in hook scripts. This approach feels error-prone and unintuitive.

For example, the following configuration will echo an empty string and the date of string interpolation, but not the date of the job's start:

  runner_hook_job_started: |
    echo $GITHUB_WORKSPACE
    echo $(date)

This PR disables interpolation of the hook script contents when they are being written to the file.

Also the link in user-data.sh to GitHub start/completed docs has been updated.

@Peter-Sh Peter-Sh changed the title Disable interpolation of HEREDOC strings containing runner hook scripts fix: Disable interpolation of HEREDOC strings containing runner hook scripts Jan 2, 2025
Interpolation was applied within the user-data.sh context, causing
unexpected empty values for variables and other unintentend effects.

While this behavior might be useful in certain cases, it requires
consistently escaping everything in hook scripts. This approach feels
error-prone and unintuitive.

For example, the following configuration will echo an empty string and
the date of string interpolation, but not the date of the job's start:
```
  runner_hook_job_started: |
    echo $GITHUB_WORKSPACE
    echo $(date)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant