@@ -92,6 +92,35 @@ write generated preview commits, update pull request comments, and publish Pages
9292content. Keep those permissions scoped to the workflow jobs that actually need
9393them.
9494
95+ Workflow Permission Scope
96+ -------------------------
97+
98+ The reusable workflows default to read-only repository access and grant write
99+ permissions at the job level when generated content must be pushed or pull
100+ requests must be updated.
101+
102+ ``tests.yml `` only needs ``contents: read `` because it checks out code, installs
103+ dependencies, and runs PHPUnit.
104+
105+ ``reports.yml `` keeps ``contents: write `` on jobs that publish or clean
106+ ``gh-pages `` content. The pull request preview comment runs as a separate job
107+ with ``pull-requests: write `` because it posts or updates the sticky preview
108+ comment. Scheduled preview cleanup uses ``pull-requests: read `` so it can
109+ distinguish open pull requests from closed or merged ones before deleting
110+ ``previews/pr-<number> `` directories.
111+
112+ ``wiki.yml `` keeps ``contents: write `` on preview, publish, and cleanup jobs
113+ because the workflow pushes wiki branches, updates the parent repository
114+ submodule pointer, promotes preview content to wiki ``master ``, and deletes
115+ stale preview branches. Jobs that inspect pull request state keep
116+ ``pull-requests: read ``.
117+
118+ The label synchronization workflow declares ``issues: read `` to copy labels from
119+ the linked issue and ``pull-requests: write `` to apply those labels to the pull
120+ request. The auto-assign workflow keeps ``issues: write `` and
121+ ``pull-requests: write `` because assignment is a write operation on both event
122+ types.
123+
95124Resolving ``.github/wiki `` Pointer Conflicts
96125--------------------------------------------
97126
0 commit comments