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
4 changes: 4 additions & 0 deletions .github/workflows/docs-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ jobs:
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.ref != '' && inputs.ref || 'main' }}
- uses: ./.github/actions/activate-conda

- name: Trust checked-out repository
shell: bash
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Restore full multi-version docs site
uses: actions/cache/restore@v4
with:
Expand Down
15 changes: 15 additions & 0 deletions tests/ci/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@ def test_automatic_pages_deployment_requires_existing_docs_artifact() -> None:
assert deploy_condition.startswith("always() &&")
assert "needs.inspect-docs-artifact.outputs.exists == 'true'" in deploy_condition
assert "inputs.artifact_run_id != ''" in deploy_condition


def test_manual_docs_build_trusts_checkout_before_architecture_generation() -> None:
jobs = _load_workflow("docs-pages.yml")["jobs"]
steps = jobs["build-and-deploy"]["steps"]
step_names = [step.get("name", "") for step in steps]

trust_index = step_names.index("Trust checked-out repository")
build_index = step_names.index("Build docs site")
trust_command = steps[trust_index]["run"]

assert trust_index < build_index
assert (
'git config --global --add safe.directory "$GITHUB_WORKSPACE"' in trust_command
)
Loading