Conversation
Call the centralized reusable workflow from reqstool/.github to validate Antora docs build cleanly on PRs and pushes to main. Signed-off-by: jimisola <jimisola@jimisola.com>
|
|
||
| jobs: | ||
| build: | ||
| uses: reqstool/.github/.github/workflows/build-docs.yml@main |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 days ago
In general, the fix is to add an explicit permissions block to the workflow (either at the top level, applying to all jobs, or inside the specific job) that grants only the minimal scopes required by the workflow. Because this workflow only delegates work to a reusable workflow, and we do not see any need for write access here, the safest minimal starting point is to set contents: read at the workflow level. This both documents the intent and ensures the GITHUB_TOKEN is not accidentally granted broader privileges via defaults.
Concretely, in .github/workflows/build-docs.yml, add a permissions block between the name: and on: keys. For a minimal, read-only token suitable for typical documentation build workflows that only need to check out code or download artifacts, use:
permissions:
contents: readThis will apply to all jobs (including the build job that uses the reusable workflow) unless they override permissions themselves. No additional imports, methods, or definitions are required; this is purely a YAML configuration change.
| @@ -1,4 +1,6 @@ | ||
| name: Build Docs | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: |
Summary
docs/**files changereqstool/.githubTest plan