Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ The Aignostics Python SDK uses a **sophisticated multi-stage CI/CD pipeline** bu
| Workflow | Purpose | Duration | Key Outputs |
|----------|---------|----------|-------------|
| **_lint.yml** | Code quality (ruff, pyright, mypy) | ~5 min | Formatted code, type safety |
| **_docs.yml** | Documentation build (Sphinx) | ~3 min | HTML docs, validation |
| **_audit.yml** | Security + license compliance | ~3 min | SBOM (CycloneDX, SPDX), vulnerabilities, licenses |
| **_test.yml** | Multi-stage test execution | ~15 min | Coverage reports, JUnit XML |
| **_codeql.yml** | Security vulnerability scanning | ~10 min | CodeQL SARIF results |
Expand Down Expand Up @@ -1099,6 +1100,7 @@ make dist_native
| `audit-scheduled.yml` | Entry | Security audit | ~5 min |
| `codeql-scheduled.yml` | Entry | CodeQL scan | ~10 min |
| `_lint.yml` | Reusable | Code quality checks | ~5 min |
| `_docs.yml` | Reusable | Documentation build | ~3 min |
| `_audit.yml` | Reusable | Security & license | ~3 min |
| `_test.yml` | Reusable | Test execution | ~15 min |
| `_codeql.yml` | Reusable | Security scanning | ~10 min |
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "> Docs"

on:
workflow_call:
# No secrets needed

jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: read
Comment on lines +12 to +13
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reusable workflow grants id-token: write and packages: read, but the steps only perform checkout, uv sync, and make docs. If you’re not accessing GitHub Packages or using OIDC in the docs build, drop these permissions and keep only contents: read to follow least-privilege.

Suggested change
id-token: write
packages: read

Copilot uses AI. Check for mistakes.
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version-file: "pyproject.toml"
enable-cache: true
cache-dependency-glob: uv.lock

- name: Install dev tools
shell: bash
run: .github/workflows/_install_dev_tools.bash

- name: Install Python, venv and dependencies
shell: bash
run: uv sync --all-extras --frozen --link-mode=copy

- name: Docs
shell: bash
run: make docs
15 changes: 14 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ jobs:
id-token: write
packages: read

docs:
needs: [get-commit-message]
if: |
(!contains(needs.get-commit-message.outputs.commit_message, 'skip:ci')) &&
(!contains(needs.get-commit-message.outputs.commit_message, 'build:native:only')) &&
(!contains(github.event.pull_request.labels.*.name, 'skip:ci')) &&
(!contains(github.event.pull_request.labels.*.name, 'build:native:only'))
uses: ./.github/workflows/_docs.yml
permissions:
contents: read
id-token: write
packages: read
Comment on lines +90 to +91
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs job requests id-token: write and packages: read, but the job only checks out the repo, installs dependencies with uv, and runs make docs. Unless docs dependencies are pulled from GitHub Packages or the job uses OIDC, these extra permissions are unnecessary and broaden the token’s scope; consider reducing to just contents: read (matching least-privilege).

Suggested change
id-token: write
packages: read

Copilot uses AI. Check for mistakes.

audit:
needs: [get-commit-message]
if: |
Expand Down Expand Up @@ -156,7 +169,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

ketryx_report_and_check:
needs: [get-commit-message, lint, audit, test, codeql, sonarcloud]
needs: [get-commit-message, lint, audit, test, codeql, sonarcloud, docs]
if: |
github.actor != 'dependabot[bot]' &&
(!contains(needs.get-commit-message.outputs.commit_message, 'skip:ci')) &&
Expand Down
Loading