fix(ci): scoped permissions for preview-smoke + visual-diff workflows #16

Merged
varutasu merged 1 commit from fix/ci-permissions-vercel-preview into main 2026-05-24 15:22:13 -04:00
2 changed files with 22 additions and 0 deletions
Showing only changes of commit a02a504511 - Show all commits

View file

@ -19,6 +19,18 @@ concurrency:
group: preview-smoke-${{ github.event.pull_request.number }} group: preview-smoke-${{ github.event.pull_request.number }}
cancel-in-progress: true cancel-in-progress: true
# Default workflow token is read-only on this repo. The `wait-for-vercel-preview`
# action needs `deployments: read` to query Vercel's GitHub Deployment status,
# plus `statuses: read` because some Vercel deployments use commit statuses
# instead of the Deployments API. `pull-requests: read` lets it correlate the
# deployment back to this PR. Without these, the action 403s on the Checks API
# and the smoke job fails before Playwright even starts.
permissions:
contents: read
deployments: read
pull-requests: read
statuses: read
jobs: jobs:
gate: gate:
name: Should run? name: Should run?

View file

@ -18,6 +18,16 @@ concurrency:
group: visual-diff-${{ github.event.pull_request.number }} group: visual-diff-${{ github.event.pull_request.number }}
cancel-in-progress: true cancel-in-progress: true
# `deployments: read` + `statuses: read` are required by wait-for-vercel-preview
# (see preview-smoke.yml for context). `pull-requests: write` is required by the
# final github-script step that posts the "Visual Diff" comment back to the PR;
# without it the API returns 403 even though the screenshots upload fine.
permissions:
contents: read
deployments: read
pull-requests: write
statuses: read
jobs: jobs:
gate: gate:
name: Should run? name: Should run?