Run GitHub Actions on forked repository for pushing certain changes #26865
-
Hi everyone, This is more of a question for everyone. I want to run GitHub Action on the forked repo for a particular PR. The action should push something on the forked repo before merging the PR. Is this possible? I was trying with the following yaml:
Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @uditgaurav, When you create a PR from forked repo to base repo, the PR is created on the On forked repo, you need to enable github action on ‘actions’ tab firstly. And then you can create a workflow (eg: event push…etc) on forked repo, to commit changes before PR merge. If you don’t have forked repo access token, you cannot commit to forked repo. If you have forked repo token, on base repo, you can checkout forked branch(get info from Github Context), commit the changes to forked repo before PR merged. Thanks |
Beta Was this translation helpful? Give feedback.
Hi @uditgaurav,
When you create a PR from forked repo to base repo, the PR is created on the
BASE
repo not forked repo. Therefore, if you comment to PR, the ‘issue_comment’ will only be triggered on base repo(if you put it on base repo default branch), not on forked repo.On forked repo, you need to enable github action on ‘actions’ tab firstly. And then you can create a workflow (eg: event push…etc) on forked repo, to commit changes before PR merge.
If you don’t have forked repo access token, you cannot commit to forked repo.
If you have forked repo token, on base repo, you can checkout forked branch(get info from Github Context), commit the changes to forked repo…