GitHub cannot handle the github context for pull_requests with html. `toJSON` fails.
@nikola-jokic is already working on this.
Since Feb 17, 2022.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
Description
Describe the bug
When a Pull Request is created with HTML in it, f.e. a Dependabot PR, the github event can not be parsed. The toJson method is not escaping the HTML parts correctly.
To Reproduce
Steps to reproduce the behavior:
- Pass the github context to an action, with the
toJSONfunction.
- Try parsing the github context when passed as in a Pull_request workflow with
jq.
I've created a repository with this setup. See PR.
- Go to https://github.com/JeroenKnoops/test-github-pull-request-event/pull/3
- Two workflows run, one on commit, and one on Pull Request. The commit is correct, the Pull Request fails because of the html in the request.
- Look at the error-log of the Pull Request: In line 735 you will see the double
\in the html part of the body of the PR. This can not be decoded byjq, that's why the workflow fails.
Expected behavior
The toJSON function should encode the HTML content of the PR body correctly.
Runner Version and Platform
Using the GitHub cloud runners.
What's not working?
parse error: Invalid escape at line 1, column 9651
See screenshot in step 3.
This has impact on ALL dependabot PRs made which triggering a pull_request event. You cannot use the github context in those cases.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.