Skip to content

Commit ccc1cd0

Browse files
steve-downeyclaude
andcommitted
docs.yml: skip PR comment step on fork PRs instead of suppressing 403
Fork PR runs always get a read-only GITHUB_TOKEN regardless of the permissions: block. The previous approach attempted the comment and relied on continue-on-error to swallow the 403, leaving a red step. Replace the condition with a same-repo guard so the step is simply skipped for fork PRs. The comment will still post for PRs opened within the bemanproject/optional repo itself. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent b30dec9 commit ccc1cd0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ jobs:
6262
# where the docs-site artifact can be downloaded and inspected.
6363
# Uses a hidden marker so the comment is updated (not duplicated) on
6464
# each push to the PR branch.
65-
# continue-on-error because fork PRs may lack write permission for
66-
# pull-requests; the build still passes even if the comment fails.
65+
# Skip on fork PRs: the GITHUB_TOKEN in a fork PR run is always
66+
# read-only regardless of the permissions: block, so the comment
67+
# would 403. Only attempt it when the PR is within the same repo.
6768
- name: Post or update PR preview comment
68-
if: github.event_name == 'pull_request'
69-
continue-on-error: true
69+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
7070
uses: actions/github-script@v7
7171
with:
7272
script: |

0 commit comments

Comments
 (0)