You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error posting PR comment: Resource not accessible by integration: 403 #143
While trying the commit-check action with the experimental pr-comments option I ran into an issue.
When using more or less the config example from the marketplace the workflow aborted. These are the lines from the log:
2025-09-11T13:53:02.4577894Z Request GET /repos/csidirop/actiontest/issues/1 failed with 403: Forbidden
2025-09-11T13:53:02.4580746Z Error posting PR comment: Resource not accessible by integration: 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/issues/issues#get-an-issue", "status": "403"}
Adding issues: write to the permissions fixes the issue. (See my commit-check.yml). I read that PR are treated like issues, but I don't know why pull-requests: write did not work. Maybe you can do something with that issue and info.
commit-check version
v1 ?
.commit-check.yml
name: Commit Checkon:
pull_request:
types: [opened, synchronize, reopened]jobs:
check:
runs-on: ubuntu-latestpermissions: # use permissions because use of pr-commentscontents: readissues: writepull-requests: writesteps:
- uses: actions/checkout@v4with:
ref: ${{ github.event.pull_request.head.sha }}fetch-depth: 0# required for merge-base check
- uses: commit-check/commit-check-action@v1 # see https://github.com/marketplace/actions/commit-check-actionenv:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with: # enable only what you needauthor-name: trueauthor-email: truebranch: falsecommit-signoff: falseimperative: falsejob-summary: truemessage: falsemerge-base: falsepr-comments: ${{ github.event_name == 'pull_request' }}
Hi, I had a bit of time this morning and did some more tests, but I got the same error every time.
However, I still think it's related to the issues permission endpoint. If you take a look at the docs you will find: issues: Work with issues. For example, issues: write permits an action to add a comment to an issue. For more information, see [Permissions required for GitHub Apps](https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-issues).
and pull-requests: Work with pull requests. For example, pull-requests: write permits an action to add a label to a pull request. For more information, see Permissions required for GitHub Apps.
I don't think either explanation is precise or (even) correct and in this case not really helpful. After a lot of digging I found the REST API Doc which states what I mentioned before:
Every pull request is an issue, [...] For this reason, "shared" actions for both features, like managing assignees, labels, and milestones, are provided within the Issues endpoints.
Which means: If we want to "add comment to an issue" (or PR! in this case) we need the issues: read/write permission.
In addition I checked the code, and if I understood correctly, the following line is using the issues endpoint:
Activity
shenxianpeng commentedon Sep 11, 2025
Hi @csidirop are you working on a fork repo?
pr-commentsdoes not work for a fork repo for now. see #77csidirop commentedon Sep 11, 2025
Hi, no it was non forked test repo with a PR from a branch part of that repo.
shenxianpeng commentedon Sep 11, 2025
Hmm, interesting, you can see
pre-commentsjust work for this PR #145 (comment)And here is my YAML config
commit-check-action/.github/workflows/commit-check.yml
Lines 9 to 31 in 04667fa
Maybe I need to create a test repo and try to reproduce this issue
csidirop commentedon Sep 17, 2025
Hi, I had a bit of time this morning and did some more tests, but I got the same error every time.
However, I still think it's related to the issues permission endpoint. If you take a look at the docs you will find:
issues: Work with issues. For example, issues: write permits an action to add a comment to an issue. For more information, see [Permissions required for GitHub Apps](https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-issues).and
pull-requests: Work with pull requests. For example, pull-requests: write permits an action to add a label to a pull request. For more information, see Permissions required for GitHub Apps.I don't think either explanation is precise or (even) correct and in this case not really helpful. After a lot of digging I found the REST API Doc which states what I mentioned before:
Which means: If we want to "add comment to an issue" (or PR! in this case) we need the
issues: read/writepermission.In addition I checked the code, and if I understood correctly, the following line is using the issues endpoint:
commit-check-action/main.py
Line 132 in a7f1b1e
Contrary to what I said before, the
issues: readpermission is sufficient to fix that error. There is no need forissues: writebut it works anyway.I hope this can help you a bit. Tell me if I can help out or do something else.
shenxianpeng commentedon Nov 17, 2025
I used the following config, and the PR comment works. see #165 (comment). It works without adding
issues: read.commit-check-action/.github/workflows/commit-check.yml
Lines 9 to 27 in 6e021a9
feat: implement graceful fork PR degradation and document workflow_ru…
feat: implement graceful fork PR degradation and document workflow_ru…
fix: handle fork PR permission issue for pr-comments gracefully (#215)