unsplash / comment-on-pr

A GitHub Action to comment on the relevant open PR when a commit is pushed.
MIT License
150 stars 84 forks source link

Does not work when called from a fork #21

Closed Ecco closed 4 years ago

Ecco commented 4 years ago
  1. Install comment-on-pr on repository foo/bar (Repo named bar of user foo)
  2. As user john, fork foo/bar into john/bar
  3. As user john, submit a PR to project foo/bar
  4. Failure
    /usr/local/bundle/gems/octokit-4.18.0/lib/octokit/response/raise_error.rb:16:
    in `on_complete': POST https://api.github.com/repos/foo/bar/issues/1/comments:
    403 - Resource not accessible by integration
    // See: https://developer.github.com/v3/issues/comments/#create-a-comment
    (Octokit::Forbidden)`
benwinding commented 4 years ago

Unfortunately, It looks like this is expected behaviour, as secrets are not available to the actions that run on forked PRs. Even in the pull_request.close event, secrets are not available...

image

It's very annoying as I want to post a comment on a forked pull-request once it's merged... anyone have any work-arounds?

Ecco commented 4 years ago

Well, that's a major limitation of GitHub actions. Actually they're close to being useless.

Here's the details:

Long story short: GitHub's limitation. No workaround possible.

Links:

Ecco commented 4 years ago

Pleas see this comprehensive description I wrote on GitHub Community that explains the whole problem. Feel free to upvote it to raise awareness 😄

per1234 commented 4 years ago

@aaronklaassen I suggest documenting this limitation.