Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 6 days ago
In general, the problem is fixed by explicitly declaring a
permissionsblock that restricts theGITHUB_TOKENto the least privileges needed. Since this workflow only triggers a reusable workflow and there is no indication it needs write access, a safe minimal default iscontents: readat the workflow root. Root‑level permissions apply to all jobs that do not override them, including thebuildjob here.The single best way to fix this without changing existing functionality is to add a root‑level
permissionssection immediately after thename:line (line 1). For example:This keeps the existing triggers and the
buildjob unchanged and only narrows the defaultGITHUB_TOKENprivileges for this workflow. No additional imports or methods are needed, since this is a GitHub Actions YAML configuration change only.Concretely:
.github/workflows/build-docs.yml.permissionsblock after line 1 (name: Build Docs), before theon:section.contents: readas a minimal, least‑privilege default suitable for a documentation build workflow that should not need to push changes or modify repo state.