Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

steps.check.outputs.comment_body is blank #6

Open
IanButterworth opened this issue Apr 7, 2020 · 6 comments
Open

steps.check.outputs.comment_body is blank #6

IanButterworth opened this issue Apr 7, 2020 · 6 comments

Comments

@IanButterworth
Copy link

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
Copy link
Author

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
Copy link

LordJZ commented Apr 14, 2020

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

@LordJZ
Copy link

LordJZ commented Apr 14, 2020

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

na4zagin3 added a commit to na4zagin3/satyrographos-repo that referenced this issue Jul 27, 2020
Workaround blank `steps.check.outputs.comment_body` with `github.event.comment.body`

See Khan/pull-request-comment-trigger#6
@kateefimova-eb
Copy link

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

@dineshsinghbisht
Copy link

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
Copy link

gal-bar commented Mar 6, 2022

someone was able to fix that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants