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

Use quotes in here doc marker #1

Merged
merged 2 commits into from
Jul 5, 2024
Merged

Use quotes in here doc marker #1

merged 2 commits into from
Jul 5, 2024

Conversation

fvictorio
Copy link
Member

If github.event.pull_request.title has backticks, like in this PR, then these actions will fail because bash will try to perform process substitution. See the "Set message" step here:

/home/runner/work/_temp/89984ac4-2532-4ab4-80f2-cdfa753d47ce.sh: line 3: ConsoleLogger: command not found

(That step also has a different here-doc related warning that is always shown. It doesn't seem to be important, but I fixed it in this PR anyway).

The solution is to quote the here-doc marker, as explained here:

If any part of word is quoted [...] the lines in the here-document are not expanded.

This means that no substitution whatsoever will happen. This is fine, because we are only using ${{format(...)}}, which is a GitHub Actions thing, not a bash thing.

I'm not sure how to test this though. I guess we can update this:

https://github.com/NomicFoundation/hardhat/blob/411fef632efe130dc55d651708faad7aad3cc021/.github/workflows/review-requested-slack-notification.yml#L7

To use the commit hash in this PR, and then send a test PR to see what happens.

@fvictorio fvictorio requested a review from alcuadrado July 2, 2024 08:21
@alcuadrado alcuadrado merged commit 0294dda into main Jul 5, 2024
@alcuadrado alcuadrado deleted the quote-here-doc branch July 5, 2024 00:29
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.

2 participants