Skip to content

Cannot use ${{ toJson(github) }} when a ' appears in the commit message. #1656

@petersutter5

Description

@petersutter5

Describe the bug
When trying to use ${{ toJson(github) }} when there is a ' in the commit message, you get an error. The error looks like,
unexpected EOF while looking for matching `"'

To Reproduce
Steps to reproduce the behavior:

  1. Have a workflow bash script that tries to run ${{ toJson(github) }} that runs on a PR
  2. Leave a commit message including a ' character
  3. Trigger the workflow by opening a PR
  4. You should see the toJson step fail with the error message above.

Expected behavior
Expected to see the full pretty printed github context

Runner Version and Platform

Current runner version: '2.287.1'

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

What's not working?

toJson expression

Job Log Output

unexpected EOF while looking for matching `"'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions