Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 3

GITHUB_TOKEN not accessable from fork, how to replace

Solved! Go to Solution.

Hello guys.

I created a very simple notifier, which uses the GITHUB_TOKEN variable to send a message in the PR concersation whenever a file in a folder changes. This works perfectly fine from PR from different branches, but fails when the PR originates from a fork with the errorResource not accessible by integration. example.

 

Now I did some research. This article states that I can access the token from a fork, but this one says that the token only has read permission when originating from a fork. So I am going to assume that I need issue write permission to create a message in the PR conversation, right?

 

If that is correct, my question is how to proceed. Do I need to create a Github App? It sounds appropriate, but it looks a bit complicated and I would love to see a better solution.

2 Replies
Highlighted
Solution
GitHub Partner
Message 2 of 3

Re: GITHUB_TOKEN not accessable from fork, how to replace

Hi @Poolitzer ,

 

As github stuff replied here, it's not supported/planed to give forks the ablity to write to main repo directly. I assume there's no easy way to comment the pull request from forked repo, thanks.

secrets.png

 

Highlighted
Copilot Lvl 2
Message 3 of 3

Re: GITHUB_TOKEN not accessable from fork, how to replace

Hey @weide-zhou,

 

thanks for that, I know now that I can't use actions directly then, great.