chore: switch back to reusable docs CI workflow#157
Conversation
now that it uses uv in reusable workflow see also cpp-linter/.github#52
WalkthroughReplaces inline build/deploy jobs in Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions
participant WF as docs workflow (.github/workflows/docs.yml)
participant Reuse as Reusable sphinx.yml
participant Pages as GitHub Pages
Dev->>GH: push to main or open PR (main)
GH->>WF: Trigger workflow (push / pull_request)
WF->>Reuse: Run docs job via uses: cpp-linter/.../sphinx.yml@main
note right of WF: Job permissions: pages: write, id-token: write
Reuse->>Reuse: Build Sphinx docs (uses PATH_TO_DOCS)
alt branch == main
Reuse->>Pages: Deploy using Pages + OIDC
else not main
Reuse-->>GH: Report build result (no deploy)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/docs.yml (2)
10-13: Confirm PATH_TO_DOCS is actually consumed by the reusable workflow.
Reusable workflows don’t automatically inherit arbitrary env from callers. If the called sphinx.yml expects an input (e.g., path_to_docs), pass it via with:, or drop this env if unused.If the reusable workflow accepts an input for the path, update like:
jobs: docs: permissions: pages: write id-token: write - uses: cpp-linter/.github/.github/workflows/sphinx.yml@main + uses: cpp-linter/.github/.github/workflows/sphinx.yml@main + with: + path_to_docs: docs/_build/html # adjust to the actual input nameTo verify the expected interface, I can look up the workflow’s inputs and adapt this PR accordingly—just confirm the repo/branch you want me to check.
15-21: Optional: add concurrency to auto-cancel superseded runs.
Saves minutes on rapid pushes to the same branch.You can add at the workflow top level:
on: push: branches: [main] pull_request: branches: [main] workflow_dispatch: +concurrency: + group: docs-${{ github.ref }} + cancel-in-progress: true
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/docs.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
.github/workflows/docs.yml (1)
6-7: Nice: CI now runs on PRs targeting main.
This will catch doc build issues before merge.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/pre-commit.yml (1)
13-14: Per-job contents: read is correct given top-level permissions: {} — optional alignment with your repo-level preferenceWith
permissions: {}at the workflow root, the reusable workflow would have no token scopes unless granted here; addingcontents: readat the job is the least-privilege fix. Noting your prior preference to managecontents: readvia repository defaults, you could alternatively drop the top-levelpermissions: {}(and this per-job block) to let repo settings apply. Pick one model to avoid confusion.Do you want to keep the hardened model (root
{}+ per-job grants) consistently across workflows, or revert to repo-level defaults for simplicity?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pre-commit.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-04T03:33:27.578Z
Learnt from: 2bndy5
PR: cpp-linter/cpp-linter#150
File: .github/workflows/release.yml:0-0
Timestamp: 2025-09-04T03:33:27.578Z
Learning: In GitHub workflows, `contents: read` permissions can be controlled via repository settings for `github.token` access rather than explicitly defining it in the workflow permissions block, as preferred by user 2bndy5.
Applied to files:
.github/workflows/pre-commit.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
now that it uses
uvin reusable workflowsee also cpp-linter/.github#52
Summary by CodeRabbit