thollander / actions-comment-pull-request

GitHub action to comment pull request
MIT License
329 stars 89 forks source link

Can I use this action to comment on PRs coming from a fork? #324

Closed mwouts closed 11 months ago

mwouts commented 11 months ago

Hi,

Thanks for this action!

I have been able to use the action to comment on PRs coming from a fork (thanks for documenting the pull_request_target event).

I my comment I would need to use the fork repository, not the target.

Do you know what I could use to get the equivalent for ${{ github.repository }} on the fork? After I switched to pull_request_target, that variable became the target repository...

https://github.com/mwouts/jupytext/blob/main/.github/workflows/step_comment-pr.yml#L26

Thanks !

mwouts commented 11 months ago

I got the answer: it's {{ github.event.pull_request.head.repo.full_name }}. Works fine now (see my workflow)! Thanks for the action, very useful.