From 7ee496fc94692e6f407e56fde74e0fe16b8e4bc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 09:08:35 +0000 Subject: [PATCH 1/2] Bump dorny/paths-filter from 3 to 4 Bumps [dorny/paths-filter](https://github.com/dorny/paths-filter) from 3 to 4. - [Release notes](https://github.com/dorny/paths-filter/releases) - [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md) - [Commits](https://github.com/dorny/paths-filter/compare/v3...v4) --- updated-dependencies: - dependency-name: dorny/paths-filter dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16d2de2d..49af9906 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v6" - name: Check for file changes - uses: dorny/paths-filter@v3 + uses: dorny/paths-filter@v4 id: changes with: token: ${{ github.token }} From 15640763d408a1451b1b31155cfc2bbda3a49f5d Mon Sep 17 00:00:00 2001 From: Pete Crocker Date: Wed, 18 Mar 2026 21:15:35 +0000 Subject: [PATCH 2/2] fix: make sidebar path detection work in both infrahub-sdk-python and infrahub-docs The sync workflow copies sidebar files from docs/sidebars/ (source) to docs/ (target), changing __dirname and breaking all hardcoded relative paths to doc content directories. Add getDocsBaseDir() to sidebar-utils.ts which probes for the SDK-repo directory layout and returns the correct base path regardless of which repo the file is executing in. Both sidebar files now use getDocsBaseDir() instead of hardcoded __dirname-relative paths. --- docs/sidebars/sidebar-utils.ts | 20 ++++++++++++++++++++ docs/sidebars/sidebars-infrahubctl.ts | 4 ++-- docs/sidebars/sidebars-python-sdk.ts | 4 ++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/sidebars/sidebar-utils.ts b/docs/sidebars/sidebar-utils.ts index 0860904c..e13f3a10 100644 --- a/docs/sidebars/sidebar-utils.ts +++ b/docs/sidebars/sidebar-utils.ts @@ -1,3 +1,23 @@ +import { existsSync } from 'fs'; +import { join } from 'path'; + +/** + * Detects the base directory containing the docs content (python-sdk/, infrahubctl/, etc.). + * + * The sidebar files live in different locations depending on which repo they are in: + * - infrahub-sdk-python: docs/sidebars/ → content is at docs/docs/ + * - infrahub-docs: docs/ → content is at docs/docs-python-sdk/ + * + * We detect the active layout by checking whether the SDK-repo content path exists. + */ +export function getDocsBaseDir(): string { + const sdkRepoDocsDir = join(__dirname, '..', 'docs'); + if (existsSync(join(sdkRepoDocsDir, 'python-sdk'))) { + return sdkRepoDocsDir; + } + return join(__dirname, 'docs-python-sdk'); +} + export function getCommandItems(files: string[], indexFile: string = 'infrahubctl.mdx'): string[] { return files .filter(file => file.endsWith('.mdx') && file !== indexFile) diff --git a/docs/sidebars/sidebars-infrahubctl.ts b/docs/sidebars/sidebars-infrahubctl.ts index bd92511d..f8efded5 100644 --- a/docs/sidebars/sidebars-infrahubctl.ts +++ b/docs/sidebars/sidebars-infrahubctl.ts @@ -1,9 +1,9 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; import {readdirSync} from 'fs'; import {join} from 'path'; -import {getCommandItems} from './sidebar-utils'; +import {getCommandItems, getDocsBaseDir} from './sidebar-utils'; -const docsDir = join(__dirname, '..', 'docs', 'infrahubctl'); +const docsDir = join(getDocsBaseDir(), 'infrahubctl'); const commandItems = getCommandItems(readdirSync(docsDir)); const sidebars: SidebarsConfig = { diff --git a/docs/sidebars/sidebars-python-sdk.ts b/docs/sidebars/sidebars-python-sdk.ts index 3adbac3e..9f32420b 100644 --- a/docs/sidebars/sidebars-python-sdk.ts +++ b/docs/sidebars/sidebars-python-sdk.ts @@ -1,9 +1,9 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; import { readdirSync } from 'fs'; import { join } from 'path'; -import { getItemsWithOrder } from './sidebar-utils'; +import { getDocsBaseDir, getItemsWithOrder } from './sidebar-utils'; -const pythonSdkDocsDir = join(__dirname, '..', 'docs', 'python-sdk'); +const pythonSdkDocsDir = join(getDocsBaseDir(), 'python-sdk'); const guidesItems = getItemsWithOrder( readdirSync(join(pythonSdkDocsDir, 'guides')),