On:issue_comment event to trigger pull_request event

I am trying to trigger a workflow that will run “as a pull_request event” via a comment in a pull request.
I want to do this so that the status check can be associated with the pull request and if successful to contribute to the verification of the pull request.
The use case is similar to what’s described here.

To give you an idea of what I am trying to achieve exactly, I want to post a checklist to a pull request once a PR is opened. Then the maintainers to manually check all the boxes in the posted comment by the workflow and eventually for the workflow to go green.

Since (very sadly) the issue_comment workflows are not taken into consideration in the same way as the pull request ones, I am trying to trigger a pull request event from an issue_comment one, by changing the body/description of the pull request.
Unfortunately, this does not trigger an “edited” pull request event as one would expect.
When I manually, via the browser, go and make the very same change that I am programmatically doing, to the pull request body, then the “edited” pull request event gets triggered as expected and everything works.

TL;DR: When I have my bot make a change to a pull request, this does not trigger an “edited” pull request event.

Is this a bug and if so, is there a workaround?

Odds are you’re using the GITHUB_TOKEN which doesn’t trigger cascading workflows.

You’ll need a PAT:


1 Like

Thanks @jsoref I wasn’t aware of this limitation and using a PAT did the trick.

1 Like