actions-comment-pull-request icon indicating copy to clipboard operation
actions-comment-pull-request copied to clipboard

Improvement: Automatically check to see if a PR actually triggered the action

Open tanner-equi opened this issue 1 year ago • 3 comments

Maybe GitHub Actions automatically support this and so this is redundant, but it is common to have actions that have multiple triggers. Since this one inherently requires a PR trigger, it would be nice to cleanly exit when that's not the current type.

tanner-equi avatar May 08 '24 13:05 tanner-equi

You can do tests such as if: github.event_name != 'pull_request' to run steps conditionally.

  • https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
  • https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

pfeerick avatar Jun 08 '24 00:06 pfeerick

You can do tests such as if: github.event_name != 'pull_request' to run steps conditionally.

That's how I have it set up. My point is that consumers shouldn't need to do that because this action is exclusively for commenting on PRs

tanner-equi avatar Jun 10 '24 14:06 tanner-equi

AFAIK, you can't provide this kind of condition in the action itself

thollander avatar Oct 09 '24 19:10 thollander