surge-preview icon indicating copy to clipboard operation
surge-preview copied to clipboard

Preview comment not being added + CI failing

Open HarshCasper opened this issue 2 years ago • 2 comments

Description

Hi,

Through this PR, I added PR preview for Devfiles using Surge: https://github.com/devfile/docs/pull/106

However, right here https://github.com/devfile/docs/pull/116, the CI fails and the preview comment is not being generated. Here are the CI logs:

   Running as [email protected] (Student)

        project: ./out/docs
         domain: devfile-docs-preview-pr-116.surge.sh


     encryption: *.surge.sh, surge.sh (136 days)
             IP: 138.197.235.123

   Success! - Published to devfile-docs-preview-pr-116.surge.sh

Error: Resource not accessible by integration

While browsing through the GitHub community, I discovered this: https://github.community/t/github-actions-are-severely-limited-on-prs/18179

However, I did not find such problems on other projects using the same action. Can I get a better direction on how I can solve this problem? Thanks a lot!

HarshCasper avatar Dec 11 '21 18:12 HarshCasper

cc: @afc163

HarshCasper avatar Dec 11 '21 18:12 HarshCasper

@HarshCasper the issue you are facing is due to the lack of permissions of the GH_TOKEN when the Pull Request is created from a fork. It only has read permissions whereas write permissions are required to create or update a Pull Request comment.

For more details, you can have a look at #146 and #198 I previously provided detailed information about how the action behaves in such case: https://github.com/process-analytics/bpmn-visualization-js/issues/1279#issuecomment-832764355

About making the action work when the Pull Request is created from a fork repository, there is currently no solution provided by the surge-preview action. An issue is opened about this topic: #124 and alternatives exist but they are based on custom GitHub workflows, see https://github.com/antvis/vis-dashboard/pull/21/files or https://github.com/debezium/debezium.github.io/blob/e462f753d264f97fb0d1a64b52f7fcec0b675875/.github/workflows/surge-preview.yml

tbouffard avatar Dec 13 '21 04:12 tbouffard