Skip to content

Fix Pages PR Preview comment permissions - #201

Merged
Dan Marshall (danmarshall) merged 3 commits into
mainfrom
copilot/fix-pages-pr-preview-deploy
Aug 19, 2026
Merged

Fix Pages PR Preview comment permissions#201
Dan Marshall (danmarshall) merged 3 commits into
mainfrom
copilot/fix-pages-pr-preview-deploy

Conversation

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

The Pages PR Preview / deploy (pull_request) job failed after successfully uploading the preview artifact because the PR comment step lacked the required token scope and ran on forked PRs where comments are not writable.

  • Workflow permissions

    • Replace pull-requests: write with issues: write, matching the issues.createComment API used by actions/github-script.
  • Fork PR handling

    • Run the preview artifact comment only for same-repository PRs.
    • Forked PRs can still build/upload the artifact without failing on the comment step.
permissions:
  pages: write
  id-token: write
  contents: read
  issues: write

# ...
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository

Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Pages PR Preview / deploy Fix Pages PR Preview comment permissions Aug 19, 2026
@danmarshall
Dan Marshall (danmarshall) marked this pull request as ready for review August 19, 2026 20:02
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
@danmarshall
Dan Marshall (danmarshall) merged commit fc54a5c into main Aug 19, 2026
6 checks passed
@danmarshall
Dan Marshall (danmarshall) deleted the copilot/fix-pages-pr-preview-deploy branch August 19, 2026 20:42
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

Successfully merging this pull request may close these issues.

2 participants