preactjs / compressed-size-action

GitHub Action that adds compressed size changes to your PRs.
https://github.com/marketplace/actions/compressed-size-action
MIT License
602 stars 84 forks source link

Fails to report stats for PRs from a fork #2

Open developit opened 4 years ago

developit commented 4 years ago

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
kuldeepkeshwar commented 4 years ago

@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 )

developit commented 4 years ago

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.

ZLY201 commented 2 years ago

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.

kuldeepkeshwar commented 2 years ago

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

ZLY201 commented 2 years ago

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

Thanks! I'll try it!