Skip to content

Triggering workflow only for Pull Request Comment #25531

Answered by BrightRan
ibakshay asked this question in Actions
Discussion options

You must be logged in to vote

Currently, there is not any easy way to set filter on Issue comment event to let workflow be triggered only when comment on PR or only on issue.

However, from the github context for the event, I found some different between issue and PR.

  • If comment on PR triggers the workflow, the value of event.comment.html_url is:

https://github.com/<org>/<repo>/pull/<pr_id>#issuecomment-<comment_id>

  • If comment on issue triggers the workflow, the value of event.comment.html_url is:

https://github.com/<org>/<repo>/issues/<issue_id>#issuecomment-<comment_id>

So you can try the below if conditional to skip all the jobs when the workflow is triggered by comment on issue.

jobs:
 job01:
    if: contains(g…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants