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 2 days ago
In general, the fix is to add an explicit permissions block that grants only the minimal GITHUB_TOKEN scopes required by this workflow. Because this workflow’s sole job delegates to a reusable workflow that builds documentation, it almost certainly only needs read access to repository contents and packages. GitHub’s recommended baseline for read‑only is permissions: contents: read (and optionally packages: read), which satisfies the CodeQL rule and documents intended access.
The single best fix here, without changing functionality, is to define permissions at the workflow root so that it applies to all jobs (including the build job that calls the reusable workflow). We’ll add, just below the on: block, a permissions: section that limits contents to read (and optionally packages to read if you want parity with GitHub’s recommended read‑only defaults). This does not change how the reusable workflow is invoked; it only constrains the GITHUB_TOKEN for this workflow’s jobs. Concretely, in .github/workflows/build-docs.yml, between the on: block (lines 2–11) and jobs: (line 13), we’ll insert:
permissions:
contents: readNo imports or additional methods are needed because this is declarative YAML configuration, not executable code.
| @@ -10,6 +10,9 @@ | ||
| paths: | ||
| - "docs/**" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| uses: reqstool/.github/.github/workflows/build-docs.yml@main |
Summary
docs/**files changereqstool/.githubTest plan