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

Does this action still work? #7

Closed heathsnow closed 4 years ago

heathsnow commented 4 years ago

No matter what I do I can't get this action to execute with a PR comment. My workflow is:

name: 'deploypr'
on:
  pull_request:
    types: [opened]
  issue_comment:
    types: [created]
jobs:
  deploypr:
    runs-on: ubuntu-latest
    steps:
      - uses: khan/pull-request-comment-trigger@master
        id: check
        with:
          trigger: 'deploy'
          prefix_only: 'true'
          reaction: rocket
        env:
          GITHUB_TOKEN: `${{ secrets.GITHUB_TOKEN }}`
      - run: 'echo Found it!'
        if: steps.check.outputs.triggered == 'true'

However when I type a comment with only the word deploy there is no action executed. Am I missing something?

heathsnow commented 4 years ago

Nevermind, it appears that the workflow must exist in the default branch. I was trying to work with it only existing in a branch for my PR.

ca-scribner commented 4 years ago

Were you trying to test the issue_comment trigger? I think the confusion comes from github triggers based on the code in the github.sha/github.ref of the event, but for the case of an issue_comment those are on the default branch.

On the other hand, the pull_request triggers will work from within a branch. If you branch, change the workflow's yaml, then make a PR, it'll fire both the master(or the branch?) and this commit's modified workflow.

ca-scribner commented 4 years ago

oh yeah here's the description of what triggers have what github_sha/github_ref