Khan / pull-request-comment-trigger

A github action for detecting a "trigger" in a pull request description or comment
207 stars 91 forks source link

`steps.check.outputs.comment_body` is blank #6

Open IanButterworth opened 4 years ago

IanButterworth commented 4 years ago

steps.check.outputs.comment_body seems to always be blank for me.

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: 'RunTest'
          prefix_only: 'true'
          reaction: rocket
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
      - run: 'echo ${{ steps.check.outputs.comment_body }}'
        if: steps.check.outputs.triggered == 'true'

I'm triggering this with a comment RunTest test1 hoping that the job runs echo RunTest test1

However I get echo as the step name and a blank echo output.

If I replace the echo with 'echo ${{ steps.check.outputs.trigger }}' I get echo true so it seems comment_body has an issue

IanButterworth commented 4 years ago

A workaround is to use github.event.comment.body

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: 'RunTest'
          prefix_only: 'true'
          reaction: rocket
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
      - run: echo '${{ github.event.comment.body }}'
        if: steps.check.outputs.triggered == 'true'
LordJZ commented 4 years ago

yeah this repository is not compiled, need to run npm run-script dist

LordJZ commented 4 years ago

or use https://github.com/peter-evans/slash-command-dispatch this is more powerful

kateefimova-eb commented 2 years ago

@IanButterworth That worked for me, thank you so much!

dineshsinghbisht commented 2 years ago

Both github.event.comment.body and steps.check.outputs.comment_body do not work for me. Any leads how to access PR comment on Github Action

gal-bar commented 2 years ago

someone was able to fix that?