Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendComments Fails when from a Forked Repo, even after setting 'Send write tokens to workflows from fork pull requests.' #19

Open
lordneeko opened this issue Jan 11, 2022 · 2 comments

Comments

@lordneeko
Copy link

I get the failure
Invoke-RestMethod: /entrypoint.ps1:61 Line | 61 | Invoke-RestMethod @params > $null | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | {"message":"Resource not accessible by | integration","documentation_url":"https://docs.github.com/rest/reference/issues#create-an-issue-comment"}

when attempting to let this lint a PR from a forked repo. I have tried following articles telling me to turn on 'Send write tokens to workflows from fork pull requests' for the organization (which I assume the repos inside it would inherit), however within the org repo there isn't an individual setting for the repo to turn this on (it is at the org level only). Trying to figure out if I'm missing something in the XAML to ensure it uses the appropriate secrets token.

@lordneeko
Copy link
Author

lordneeko commented Jan 11, 2022

I just saw #2 that is closed, however it appears that the GitHub actions setting SHOULD forward the write permission to the workflow...
https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/
This was added in Aug 2020

Alternatively,
Is there a way to have it "Sendcomments: true" on a non-fork and Sendcomments:False on a forked repo?

@alagoutte
Copy link
Contributor

Hi,

You need to add to have 2 workflows
and use on: [pull_request] for make the difference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants