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 7 days ago
In general, the problem is fixed by adding an explicit
permissionsblock either at the root of the workflow (applies to all jobs) or under the specific job. Since this workflow only delegates to a reusable workflow, the top-level workflow itself typically only needs read access to repository contents (for checkout or for the reusable workflow to read docs). A minimal and safe configuration ispermissions: contents: readat the workflow level.The best way to fix this specific file without changing existing functionality is to add a root-level
permissionssection beneath thename(or at the same top level asonandjobs). This will apply to all jobs, includingbuild, unless that job or the called reusable workflow overrides permissions. Given the information available, we should choose a least-privilege default:contents: read. If the reusable workflow requires more (e.g., to publish pages or comment on PRs), it can still request elevated permissions in its own file; our addition here will not break that, since job-level permissions in the reusable workflow can be more specific. Concretely, in.github/workflows/build-docs.yml, insert:at the top level between
name: Build Docsandon:(or immediately beforejobs:; both are valid). No imports or external methods are needed.