fix(ci): scoped permissions for preview-smoke + visual-diff workflows #16
2 changed files with 22 additions and 0 deletions
12
.github/workflows/preview-smoke.yml
vendored
12
.github/workflows/preview-smoke.yml
vendored
|
|
@ -19,6 +19,18 @@ concurrency:
|
|||
group: preview-smoke-${{ github.event.pull_request.number }}
|
||||
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:
|
||||
gate:
|
||||
name: Should run?
|
||||
|
|
|
|||
10
.github/workflows/visual-diff.yml
vendored
10
.github/workflows/visual-diff.yml
vendored
|
|
@ -18,6 +18,16 @@ concurrency:
|
|||
group: visual-diff-${{ github.event.pull_request.number }}
|
||||
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:
|
||||
gate:
|
||||
name: Should run?
|
||||
|
|
|
|||
Loading…
Reference in a new issue