compressed-size-action icon indicating copy to clipboard operation
compressed-size-action copied to clipboard

Fails to report stats for PRs from a fork

Open developit opened this issue 5 years ago • 5 comments

Currently certain PR's coming from forks result in the action running in the context of the fork, which means it can't post a comment or a PR review to the PR/issue.

Possible workarounds:

  1. Report the size table back using a Status Check
    • Not sure if GitHub's UI will handle this
    • Not sure if status checks have the same permissions issue
    • Not sure if status checks for the HEAD or merge commit on a PR show on the PR itself

developit avatar Jan 24 '20 21:01 developit

@developit In case of forks, the passed GITHUB_TOKEN has read-only permission (due to security constraints), even if we go for status check, the token will still have read-only permission and won't be able to update upstream.

The ideal solution for such case is Github App(I was hacking around the same problem while creating Size plugin bot, my initial idea was to go for Github Action, but couldn't find any workaround )

kuldeepkeshwar avatar Feb 19 '20 05:02 kuldeepkeshwar

Yeah, it's not great that actions have this limitation. I had actually tried doing a status check version of this and came to the same conclusion.

developit avatar Feb 19 '20 17:02 developit

Maybe change this action to github app?

Just like coveralls/coveralls, it has a github robot named coveralls.

When you run coveralls the robot will comment in the PR.

We can even invite the robot as a outside collaborator to ensure it has the comment permission.

ZLY201 avatar Oct 21 '22 09:10 ZLY201

@ZLY201 GitHub robot is already there size-plugin-bot

kuldeepkeshwar avatar Oct 21 '22 13:10 kuldeepkeshwar

@ZLY201 GitHub robot is already there size-plugin-bot

Thanks! I'll try it!

ZLY201 avatar Oct 21 '22 13:10 ZLY201