When a PR is opened by a GitHub integration such as Dependabot, the GitHub Action that posts the "Thanks for creating a pull request!" comment with the checklist, fails with the following log:
RequestError [HttpError]: Resource not accessible by integration
Error: Unhandled error: HttpError: Resource not accessible by integration
at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:9537:21
at process.processTicksAndRejections (node:internal/process/task_queues:104:5) {
status: 403,
response: {
url: 'https://api.github.com/repos/wiredtiger/wiredtiger/issues/xxxx/comments',
status: 403,
Root cause
In .github/workflows/pr_checklist.yml the job tries to create a PR comment using: github.rest.issues.createComment(...)
The token available to the workflow does not have sufficient write permission for PR comments in this event context.
Fix
Grant explicit pull-requests: write permissions to this workflow/job.
name: PR Checklist
on:
pull_request:
types:
- opened
permissions:
contents: read
pull-requests: write
- related to
-
WT-18195
Prevent duplicate PR checklist comments on release branches
-
- Open
-