Skip to content

ci: fix preview acknowledgement comment (pull-requests: write on authorize job) - #283

Merged
RGood merged 1 commit into
mainfrom
m05/fix-preview-ack-permission
Nov 11, 2026
Merged

RGood merged 1 commit into
mainfrom
m05/fix-preview-ack-permission

Conversation

@RGood

@RGood RGood commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Problem

The M05 live test (/preview on a PR) fails in the authorize job. Authorization passes, but posting the acknowledgement comment is rejected:

HttpError: Resource not accessible by integration (POST /repos//issues/282/comments)

The response header shows the permissions the endpoint requires: x-accepted-github-permissions: issues=write; pull_requests=write. Commenting on a pull request needs both. After #247 the job had issues: write and pull-requests: read. Failing run: https://github.com/reddit/devvit-docs/actions/runs/43067039332

Fix

Change the authorize job's pull-requests permission from read to write (one line). This job:

  • runs only code from the default branch (ref: ${{ github.sha }}, persist-credentials: false),
  • never checks out or executes PR code,
  • is gated on the commenter being OWNER/MEMBER/COLLABORATOR with write+ repository permission.

The preview job, which does run PR code, is unchanged and keeps contents: read only.

Testing

issue_comment workflows run from the default branch, so this cannot be tested on the PR. After merge, comment /preview on a test PR (I have draft PR #282 ready) and confirm: acknowledgement comment appears, the preview job starts, and its token has only Contents: read.

Part of M05 follow-up.

@RGood
RGood requested review from a team and ben-harris-5 November 11, 2026 17:21
@RGood
RGood merged commit 13269dc into main Nov 11, 2026
5 checks passed
@RGood
RGood deleted the m05/fix-preview-ack-permission branch November 11, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants