Skip to content

Commit

Permalink
Sanitizing comments JSON (#30356)
Browse files Browse the repository at this point in the history
Before parsing JSON we need to sanitize JSON returned by Github API.
  • Loading branch information
victoralfaro-dotcms authored Oct 16, 2024
1 parent f08970d commit 167058a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/issue_comp_link-issue-to-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
const prUrl = '${{ inputs.pr_url }}';
let prList = `PRs:\n- ${prUrl}`;
let existingCommentId = '';
const comments = JSON.parse('${{ steps.get_comments.outputs.comments }}'.replace('\n', '\\n'));
const comments = JSON.parse(${{ toJSON(steps.get_comments.outputs.comments) }});
for(comment of comments) {
const commentBody = comment.body;
Expand Down Expand Up @@ -109,5 +109,5 @@ jobs:
owner: '${{ github.repository_owner }}',
repo: '${{ github.event.repository.name }}',
comment_id: ${{ steps.check_comment.outputs.existing_comment_id }},
body: `${prs.join('\n')}`,
body: prs.join('\n')
});

0 comments on commit 167058a

Please sign in to comment.