fix(ci): scoped permissions for preview-smoke + visual-diff workflows #16
No reviewers
Labels
No labels
agent-context-drift
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: rstillwell/deckhearth#16
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ci-permissions-vercel-preview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Both Playwright-on-Vercel workflows (
preview-smoke.yml,visual-diff.yml) have been failing on every PR with 403 "Resource not accessible by integration" at the very first action (patrickedqvist/wait-for-vercel-preview@v1.3.2). This blocks two visible CI checks (Playwright smoke,Screenshot diff) and prevents any visual-regression signal from posting back to PRs.Root cause: neither workflow declares a
permissions:block, so the workflowGITHUB_TOKENfalls back to this repo's default (read-only). The Vercel wait-action and the PR-comment script both need scopes the default doesn't grant.Fix
Minimal, least-privilege scoped
permissions:blocks per workflow:preview-smoke.ymlcontents: readpreview-smoke.ymldeployments: readwait-for-vercel-previewqueries the GitHub Deployments API for Vercel's per-PR deployment statuspreview-smoke.ymlpull-requests: readpreview-smoke.ymlstatuses: readvisual-diff.ymlvisual-diff.ymlpull-requests: write⬆️github-scriptstep posts a "Visual Diff" comment to the PR; previously 403'd onPOST /repos/.../issues/15/commentsEvidence the diagnosis is right
Failure logs from PR #15 (the run that prompted this fix):
The
x-accepted-github-permissionsresponse header is GitHub explicitly telling us which scopes it would have accepted —pull-requests: writeis the idiomatic choice (issues: writealso works but is broader than needed for PR comments).What this does NOT change
package.json, no convoy docs.Test plan
yamllint-equivalent: workflow YAML parses (verified via localactionlintsubstitute — no linter errors on either file)Playwright smokeandScreenshot diffshould reach their actual test step instead of dying at the wait-action.pages/**: confirmvisual-diff.ymlposts a "Visual Diff" comment back to the PR.Follow-ups (out of scope, queued)
Playwright smokenow surfaces real test failures or missing baselines (likely — it's never actually run end-to-end on a green token before), that's a separate convoy. This PR is permissions-only.wait-for-vercel-previewshould be replaced with a Vercel-API-direct poll that avoids the GitHub Deployments dance entirely.Made with Cursor
The latest updates on your projects. Learn more about Vercel for GitHub.
Pipeline Health
Build + CI gates
Build runs on Vercel; this CI runs lint and schema-map drift only (no duplicate build).
Role reports
See individual comments above for details. This rollup updates automatically.