'Access a GitHub issue comment body using GitHub Actions?

I used Khan package to trigger an GitHub action when a PR is being submitted with specific comment, I was managed to do that with his package, but I cannot retrieve the comment body.

Can someone guide me on how?

'Terraform GitHub Actions'
on:
  pull_request:
    types: [opened]
  issue_comment:
    types: [created]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: khan/pull-request-comment-trigger@master
        id: check
        with:
          trigger: 'account-'
          prefix_only: true
          reaction: rocket
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
      - run: echo '${{ github.event.comment.body }}'
        if: steps.check.outputs.triggered == 'true'





Solution 1:[1]

EDIT: looks like this is broken.

It looks like the khan/pull-request-comment-trigger github action returns the comment body as an output. Try accessing it using steps.check.outputs.comment_body. A fixed excerpt from your code:

      - run: echo '${{ steps.check.outputs.comment_body }}'
        if: steps.check.outputs.triggered == 'true'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1