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

Assign pull-requests: write permission to build action #263

Closed
amal-stack opened this issue Feb 28, 2023 · 6 comments
Closed

Assign pull-requests: write permission to build action #263

amal-stack opened this issue Feb 28, 2023 · 6 comments

Comments

@amal-stack
Copy link
Contributor

amal-stack commented Feb 28, 2023

For GitHub actions to comment on a PR, the pull-requests: write permission is required. See: [this discussion].(https://github.com/orgs/community/discussions/26644)
The lack of this permission is causing the Resource not available by integration error for the build action.
This permission can be added to build.yml as:

 permissions:
      pull-requests: write

I have tried this on my fork and the build passes and adds the comment successfully: amal-stack#2.

Also, see: Assigning Permissions to Jobs.

@ardalis
Copy link
Owner

ardalis commented Feb 28, 2023

Added to my build script, thanks! Need to test it out.

@ardalis ardalis closed this as completed Feb 28, 2023
@ardalis
Copy link
Owner

ardalis commented Feb 28, 2023

Ok I added this but it's still failing. Any idea why?

@ardalis ardalis reopened this Feb 28, 2023
@amal-stack
Copy link
Contributor Author

This is apparently due to a policy change by GitHub. See marocchino/sticky-pull-request-comment#227.

@ardalis
Copy link
Owner

ardalis commented Jul 25, 2023

Probably need the same thing @sadukie did on my Result project.
ardalis/Result#125

@sadukie
Copy link
Contributor

sadukie commented Jul 31, 2023

@ardalis It looks like I somehow added this back in March. It looks to be working, according to this PR: #283

Looking at past actions

  • The ".NET Core" pipeline has more triggers than just a PR. Where it gets triggered in a non-PR trigger, the comment to PR workflow is skipped.
  • The action will fail if it is triggered on its own. It relies on some steps in the ".NET Core" pipeline.

I think this issue can be closed.

@sadukie
Copy link
Contributor

sadukie commented Jul 31, 2023

Added in this PR: #265

@ardalis ardalis closed this as completed Jul 31, 2023
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

3 participants