chore(ci): set top-level permissions on workflows#1057
Conversation
Set an explicit least-privilege permissions block so the workflow GITHUB_TOKEN is scoped to contents: read instead of inheriting the repository default. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 0206dda. Configure here.
| HUSKY: 0 | ||
|
|
||
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
Missing actions: write permission breaks artifact upload
Medium Severity
Setting top-level permissions with only contents: read causes all other permissions (including actions) to default to none. The actions/upload-artifact@v6 action (v4+) requires actions: write to upload artifacts via the new backend. This means the "Upload test results" step will fail when visual regression tests fail, preventing developers from accessing the Playwright report needed to debug failures.
Reviewed by Cursor Bugbot for commit 0206dda. Configure here.


Small hardening change: set
permissions: contents: readat the top of.github/workflows/build-health-checkup.yml,.github/workflows/code-quality.yml,.github/workflows/unit-tests.yml,.github/workflows/visual-regression-tests.ymlso the workflow token is read-only instead of inheriting the repository default. The job only does checkout and build/test, so nothing else is required.Note
Low Risk
Workflow-only least-privilege hardening with no application or runtime behavior changes.
Overview
Adds top-level
permissions: contents: readto four GitHub Actions workflows (build-health-checkup,code-quality,unit-tests, andvisual-regression-tests) so the defaultGITHUB_TOKENis read-only instead of inheriting the repo’s broader default permissions.These jobs only check out code and run install/build/test (and upload artifacts on failure in visual regression), so no write scopes are required for normal operation.
Reviewed by Cursor Bugbot for commit 0206dda. Bugbot is set up for automated code reviews on this repo. Configure here.