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 6 days ago
In general, fix this by explicitly setting a permissions: block for the workflow or for the specific job, granting only the minimal scopes required. Because this workflow only delegates to a reusable workflow and likely needs no write access itself, a conservative choice is to set contents: read at the workflow root so it applies to all jobs (including build).
Concretely, in .github/workflows/build-docs.yml, add a permissions: section directly under the name: Build Docs line (before on:) with least-privilege settings. A minimal and safe starting point that satisfies CodeQL and GitHub’s recommendations is:
permissions:
contents: readThis does not change the functional behavior of the workflow steps themselves (they can still read the repository), but it prevents unintended write access through GITHUB_TOKEN unless explicitly re-granted elsewhere (e.g., in the reusable workflow, if needed).
| @@ -1,4 +1,6 @@ | ||
| name: Build Docs | ||
| permissions: | ||
| contents: read | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: |
Summary
docs/**files changereqstool/.githubTest plan