From 26f565b3ce5fd147cf3eccdee6f32914f4510b64 Mon Sep 17 00:00:00 2001 From: timurscribe Date: Tue, 9 Sep 2025 13:54:23 +0300 Subject: [PATCH 1/2] refactor docusaurus config to support environment-based branch handling --- docusaurus.config.js | 618 ++++++++++++++++++++++--------------------- 1 file changed, 316 insertions(+), 302 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 75cf289f..4a05d7c4 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -3,321 +3,335 @@ const lightCodeTheme = require('prism-react-renderer/themes/github'); const darkCodeTheme = require('prism-react-renderer/themes/dracula'); -var branch = require('child_process') - .execSync('git branch --show-current') - .toString().trim(); -branch = branch ? branch : process.env.HEAD?.toString() ?? ""; -var isPullRequest = process.env.PULL_REQUEST === "true"; +// hard override for prod-like docs (useful for submodule on master) +const FORCE_PROD = String(process.env.DOCS_ALWAYS_PROD || '').toLowerCase() === 'true'; + +// existing: +const {execSync} = require('child_process'); +let branch = 'main'; +try { + branch = execSync('git branch --show-current', {stdio: ['ignore', 'pipe', 'ignore']}) + .toString().trim() || branch; +} catch { + branch = process.env.HEAD || process.env.GIT_BRANCH || branch; +} +var isPullRequest = String(process.env.PULL_REQUEST || '').toLowerCase() === 'true'; + +// compute “channel” with the override first +const branchLc = (branch || '').toLowerCase(); +const channel = FORCE_PROD + ? 'release' + : (isPullRequest ? 'preview' + : /^(dev|develop|development)$/.test(branchLc) ? 'dev' : 'release'); + // console.log(process.env); /** @type {import('@docusaurus/types').Config} */ const config = { - /*scripts: [ - { - src: 'https://cdn.gtranslate.net/widgets/latest/dwf.js', - defer: true - } - ],*/ - clientModules: [ - require.resolve('./static/js/gTranslate.js'), - ], - plugins: [ - require.resolve('docusaurus-lunr-search'), - [ - '@docusaurus/plugin-sitemap', + /*scripts: [ { - id: 'sitemap', - changefreq: 'weekly', - priority: 0.5, - ignorePatterns: ['/tags/**'], - filename: 'sitemap.xml', + src: 'https://cdn.gtranslate.net/widgets/latest/dwf.js', + defer: true } - ] - // [ - // "@docusaurus/plugin-client-redirects", - // { - // createRedirects(existingPath) { - // if (existingPath.includes('docs/advanced-guide/ssc-regulations')) { - // // Redirect from /docs/team/X to /community/X and /docs/support/X to /community/X - // return [ - // existingPath.replace('/advanced-guide/ssc-regulations/ssdfpolicies', '/ssdfpolicies'), - // existingPath.replace('/advanced-guide/ssc-regulations/slsapolicies', '/slsapolicies'), - // ]; - // } - // } - // } - // ] - ], + ],*/ + clientModules: [ + require.resolve('./static/js/gTranslate.js'), + ], + plugins: [ + require.resolve('docusaurus-lunr-search'), + [ + '@docusaurus/plugin-sitemap', + { + id: 'sitemap', + changefreq: 'weekly', + priority: 0.5, + ignorePatterns: ['/tags/**'], + filename: 'sitemap.xml', + } + ] + // [ + // "@docusaurus/plugin-client-redirects", + // { + // createRedirects(existingPath) { + // if (existingPath.includes('docs/advanced-guide/ssc-regulations')) { + // // Redirect from /docs/team/X to /community/X and /docs/support/X to /community/X + // return [ + // existingPath.replace('/advanced-guide/ssc-regulations/ssdfpolicies', '/ssdfpolicies'), + // existingPath.replace('/advanced-guide/ssc-regulations/slsapolicies', '/slsapolicies'), + // ]; + // } + // } + // } + // ] + ], - title: 'The Scribe Documentation Site', - tagline: 'Four legs good. Two legs bad.', - url: 'https://profound-wisp-8a86b9.netlify.app/', - baseUrl: process?.env?.DOCUSAURUS_BASE_URL || '/', //onBrokenLinks: 'throw', - onBrokenLinks: 'warn', - onBrokenMarkdownLinks: 'warn', - favicon: 'img/favicon.ico', + title: 'The Scribe Documentation Site', + tagline: 'Four legs good. Two legs bad.', + url: 'https://profound-wisp-8a86b9.netlify.app/', + baseUrl: String(process.env.DOCUSAURUS_BASE_URL || '/'),// onBrokenLinks: 'warn', + onBrokenMarkdownLinks: 'warn', + favicon: 'img/favicon.ico', - // GitHub pages deployment config. - // If you aren't using GitHub pages, you don't need these. - organizationName: 'facebook', // Usually your GitHub org/user name. - projectName: 'docusaurus', // Usually your repo name. - // Even if you don't use internalization, you can use this field to set useful - // metadata like html lang. For example, if your site is Chinese, you may want - // to replace "en" with "zh-Hans". - i18n: { - defaultLocale: 'en', - locales: ['en'], - }, + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: 'facebook', // Usually your GitHub org/user name. + projectName: 'docusaurus', // Usually your repo name. + // Even if you don't use internalization, you can use this field to set useful + // metadata like html lang. For example, if your site is Chinese, you may want + // to replace "en" with "zh-Hans". + i18n: { + defaultLocale: 'en', + locales: ['en'], + }, - presets: [ - [ - 'classic', - /** @type {import('@docusaurus/preset-classic').Options} */ - ({ - docs: { - include: [ - ...((isPullRequest && branch.includes("dev-preview") || - (!isPullRequest && branch == "dev") )) ? [ - '**/*.md', - ] : [ - "introducing-scribe/what-is-scribe.md", - "introducing-scribe/scribe-hub.md", - "introducing-scribe/stand-alone.md", - "quick-start/demo.md", - "quick-start/set-up-integration/set-up-github.md", - "quick-start/set-up-integration/set-up-jenkins.md", - "quick-start/set-up-integration/set-up-azure.md", - "guides/manag-sbom-and-vul.md", - "guides/secure-sfw-slsa/README.md", - "guides/secure-sfw-slsa/slsa-lvl-1.md", - "guides/secure-sfw-slsa/slsa-lvl-2.md", - "guides/secure-sfw-slsa/slsa-lvl-3.md", - "guides/secure-sfw-slsa/customizing-provenance.md", - "guides/secure-sfw-slsa/basic-examples.md", - // "guides/secure-sfw-slsa/cosign-keyverno.md", - "guides/secure-sfw-slsa/slsapolicies.md", - "guides/ssdf-compliance/README.md", - "guides/ssdf-compliance/ssdfpolicies.md", - "guides/enforcing-sdlc-policy.md", - "guides/securing-builds.md", - "integrating-scribe/ci-integrations/README.md", - "integrating-scribe/ci-integrations/github/github.md", - "integrating-scribe/ci-integrations/github/action-slsa.md", - "integrating-scribe/ci-integrations/github/action-bom.md", - "integrating-scribe/ci-integrations/github/action-verify.md", - "integrating-scribe/ci-integrations/github/action-evidence.md", - "integrating-scribe/ci-integrations/github/action-installer.md", - "integrating-scribe/ci-integrations/jenkins.md", - "integrating-scribe/ci-integrations/example.md", - "integrating-scribe/ci-integrations/general.md", - "integrating-scribe/ci-integrations/azure.md", - "integrating-scribe/ci-integrations/bitbucket.md", - "integrating-scribe/ci-integrations/circleci.md", - "integrating-scribe/ci-integrations/gitlabci.md", - "integrating-scribe/ci-integrations/travis.md", - "integrating-scribe/ci-integrations/tekton.md", - "integrating-scribe/ci-integrations/valint-ci-configuration.md", - "integrating-scribe/other-evidence-stores.md", - "integrating-scribe/vulnerability-scanners.md", - // "integrating-scribe/git-repositories.md", - // "integrating-scribe/package-repositories.md", - "valint/README.md", - "valint/overview.md", - "valint/getting-started-valint.md", - "valint/attestations.md", - "valint/generic.md", - "valint/pram_summary.md", - "valint/policy-results.md", - "valint/policies.md", - "valint/sbom.md", - "valint/cosign.md", - "valint/configuration.md", - "valint/pram_summary.md", - "valint/help/reference.md", - "valint/help/valint.md", - "valint/help/valint_bom.md", - "valint/help/valint_verify.md", - "valint/help/valint_slsa.md", - "valint/help/valint_list.md", - "valint/help/valint_discard.md", - "valint/help/valint_download.md", - "valint/help/valint_evidence.md", - "integrating-scribe/admission-controller/gatekeeper-provider.md", - "integrating-scribe/admission-controller/kyverno.md", - "scribe-hub-reports/README.md", - "scribe-hub-reports/product.md", - "scribe-hub-reports/compliance.md", - "scribe-hub-reports/context.md", - // "scribe-hub-reports/evidence.md", - "scribe-hub-reports/advisories.md", - "scribe-hub-reports/investigation.md", - "scribe-hub-reports/licenses.md", - "scribe-hub-reports/sbom.md", - "scribe-hub-reports/vulnerabilities.md", - "scribe-api/README.md", - // "advanced-guide/generating-sboms.md", - // "advanced-guide/source-code-integrity.md", - // "advanced-guide/standalone-deployment/README.md", - // "advanced-guide/standalone-deployment/signVerify.md", - // "advanced-guide/standalone-deployment/action-bom.md", - // "advanced-guide/standalone-deployment/action-verify.md", - // "advanced-guide/standalone-deployment/action-installer.md", - // "advanced-guide/standalone-deployment.md", - // "advanced-guide/action-bom.md", - // "advanced-guide/action-verify.md", - // "advanced-guide/action-installer.md", - // "advanced-guide/ssc-regulations/README.md", - // "advanced-guide/ssc-regulations/slsapolicies.md", - // "advanced-guide/ssc-regulations/ssdfpolicies.md" - ], - ], - sidebarPath: require.resolve('./sidebars.js'), - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - // editUrl: - // 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', - }, - theme: { - customCss: require.resolve('./src/css/custom.css'), - }, + presets: [ + [ + 'classic', + /** @type {import('@docusaurus/preset-classic').Options} */ + ({ + docs: { + include: [ + ...((channel === 'dev' || channel === 'preview')) ? [ + '**/*.md', + ] : [ + "introducing-scribe/what-is-scribe.md", + "introducing-scribe/scribe-hub.md", + "introducing-scribe/stand-alone.md", + "quick-start/demo.md", + "quick-start/set-up-integration/set-up-github.md", + "quick-start/set-up-integration/set-up-jenkins.md", + "quick-start/set-up-integration/set-up-azure.md", + "guides/manag-sbom-and-vul.md", + "guides/secure-sfw-slsa/README.md", + "guides/secure-sfw-slsa/slsa-lvl-1.md", + "guides/secure-sfw-slsa/slsa-lvl-2.md", + "guides/secure-sfw-slsa/slsa-lvl-3.md", + "guides/secure-sfw-slsa/customizing-provenance.md", + "guides/secure-sfw-slsa/basic-examples.md", + // "guides/secure-sfw-slsa/cosign-keyverno.md", + "guides/secure-sfw-slsa/slsapolicies.md", + "guides/ssdf-compliance/README.md", + "guides/ssdf-compliance/ssdfpolicies.md", + "guides/enforcing-sdlc-policy.md", + "guides/securing-builds.md", + "integrating-scribe/ci-integrations/README.md", + "integrating-scribe/ci-integrations/github/github.md", + "integrating-scribe/ci-integrations/github/action-slsa.md", + "integrating-scribe/ci-integrations/github/action-bom.md", + "integrating-scribe/ci-integrations/github/action-verify.md", + "integrating-scribe/ci-integrations/github/action-evidence.md", + "integrating-scribe/ci-integrations/github/action-installer.md", + "integrating-scribe/ci-integrations/jenkins.md", + "integrating-scribe/ci-integrations/example.md", + "integrating-scribe/ci-integrations/general.md", + "integrating-scribe/ci-integrations/azure.md", + "integrating-scribe/ci-integrations/bitbucket.md", + "integrating-scribe/ci-integrations/circleci.md", + "integrating-scribe/ci-integrations/gitlabci.md", + "integrating-scribe/ci-integrations/travis.md", + "integrating-scribe/ci-integrations/tekton.md", + "integrating-scribe/ci-integrations/valint-ci-configuration.md", + "integrating-scribe/other-evidence-stores.md", + "integrating-scribe/vulnerability-scanners.md", + // "integrating-scribe/git-repositories.md", + // "integrating-scribe/package-repositories.md", + "valint/README.md", + "valint/overview.md", + "valint/getting-started-valint.md", + "valint/attestations.md", + "valint/generic.md", + "valint/pram_summary.md", + "valint/policy-results.md", + "valint/policies.md", + "valint/sbom.md", + "valint/cosign.md", + "valint/configuration.md", + "valint/pram_summary.md", + "valint/help/reference.md", + "valint/help/valint.md", + "valint/help/valint_bom.md", + "valint/help/valint_verify.md", + "valint/help/valint_slsa.md", + "valint/help/valint_list.md", + "valint/help/valint_discard.md", + "valint/help/valint_download.md", + "valint/help/valint_evidence.md", + "integrating-scribe/admission-controller/gatekeeper-provider.md", + "integrating-scribe/admission-controller/kyverno.md", + "scribe-hub-reports/README.md", + "scribe-hub-reports/product.md", + "scribe-hub-reports/compliance.md", + "scribe-hub-reports/context.md", + // "scribe-hub-reports/evidence.md", + "scribe-hub-reports/advisories.md", + "scribe-hub-reports/investigation.md", + "scribe-hub-reports/licenses.md", + "scribe-hub-reports/sbom.md", + "scribe-hub-reports/vulnerabilities.md", + "scribe-api/README.md", + // "advanced-guide/generating-sboms.md", + // "advanced-guide/source-code-integrity.md", + // "advanced-guide/standalone-deployment/README.md", + // "advanced-guide/standalone-deployment/signVerify.md", + // "advanced-guide/standalone-deployment/action-bom.md", + // "advanced-guide/standalone-deployment/action-verify.md", + // "advanced-guide/standalone-deployment/action-installer.md", + // "advanced-guide/standalone-deployment.md", + // "advanced-guide/action-bom.md", + // "advanced-guide/action-verify.md", + // "advanced-guide/action-installer.md", + // "advanced-guide/ssc-regulations/README.md", + // "advanced-guide/ssc-regulations/slsapolicies.md", + // "advanced-guide/ssc-regulations/ssdfpolicies.md" + ], + ], + sidebarPath: require.resolve('./sidebars.js'), + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + // editUrl: + // 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', + }, + theme: { + customCss: require.resolve('./src/css/custom.css'), + }, - }), + }), + ], ], - ], - themeConfig: + themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ - ({ - // announcementBar: { - // id: 'new_documentation', - // content: - // 'The new Scribe documentation website is live!', - // backgroundColor: '#fafbfc', - // textColor: '#091E42', - // isCloseable: false, - // }, - tableOfContents: { - minHeadingLevel: 2, - maxHeadingLevel: 5, - }, - navbar: { - // title: 'My Site', - logo: { - alt: 'Scribe Security Logo', - src: 'img/Scribe_dark.svg', - srcDark: 'img/Scribe_white.svg', - href: 'https://scribesecurity.com/', - }, - items: [ - { - type: 'html', - position: 'right', - value: '
', - }, - // { - // type: 'doc', - // docId: 'overview', - // position: 'left', - // label: 'Overview', - // }, - // { - // type: 'doc', - // docId: 'intro', - // position: 'left', - // label: 'Getting Started', - // }, - // {to: 'docs/introducing-scribe/what-is-scribe', label: 'What Is Scribe', position: 'left'}, - // {to: 'docs/quick-start/demo', label: 'Quick Start', position: 'left'}, - // {to: 'docs/guides/manag-sbom-and-vul', label: 'Guides', position: 'left'}, - // {to: 'docs/integrating-scribe/ci-integrations', label: 'Integrating with Scribe', position: 'left'}, - // {to: 'docs/advanced-guide/standalone-deployment', label: 'Advanced Guide', position: 'left'}, - // {to: 'docs/scribe-hub-reports', label: 'Scribe Hub Reports', position: 'left'}, - // {to: 'docs/scribe-api', label: 'Scribe API', position: 'left'}, - // { - // type: 'doc', - // docId: 'sampleproject', - // position: 'left', - // label: 'Sample Project', - // }, - // { - // type: 'doc', - // docId: 'cves', - // position: 'left', - // label: 'Detecting CVEs', - // }, - // { - // type: 'doc', - // docId: 'readingoutput', - // position: 'left', - // label: 'Reading Analysis', - // }, - // { - // type: 'doc', - // docId: 'cveReports', - // position: 'left', - // label: 'CVE Reports', - // }, - // { - // type: 'doc', - // docId: 'glossary', - // position: 'left', - // label: 'Glossary', - // } - // {to: '/blog', label: 'Blog', position: 'left'}, - // { - // href: 'https://github.com/facebook/docusaurus', - // label: 'GitHub', - // position: 'right', - // }, - ], - }, - // footer: { - // style: 'dark', - // links: [ - // { - // title: 'Docs', - // items: [ - // { - // label: 'Tutorial', - // to: '/docs/intro', - // }, - // ], - // }, - // { - // title: 'Community', - // items: [ - // { - // label: 'Stack Overflow', - // href: 'https://stackoverflow.com/questions/tagged/docusaurus', - // }, - // { - // label: 'Discord', - // href: 'https://discordapp.com/invite/docusaurus', - // }, - // { - // label: 'Twitter', - // href: 'https://twitter.com/docusaurus', - // }, - // ], - // }, - // { - // title: 'More', - // items: [ - // { - // label: 'GitHub', - // href: 'https://github.com/facebook/docusaurus', - // }, - // ], - // }, - // ], - // copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, - // }, - prism: { - theme: lightCodeTheme, - darkTheme: darkCodeTheme, - }, - }), + ({ + // announcementBar: { + // id: 'new_documentation', + // content: + // 'The new Scribe documentation website is live!', + // backgroundColor: '#fafbfc', + // textColor: '#091E42', + // isCloseable: false, + // }, + tableOfContents: { + minHeadingLevel: 2, + maxHeadingLevel: 5, + }, + navbar: { + // title: 'My Site', + logo: { + alt: 'Scribe Security Logo', + src: 'img/Scribe_dark.svg', + srcDark: 'img/Scribe_white.svg', + href: 'https://scribesecurity.com/', + }, + items: [ + { + type: 'html', + position: 'right', + value: '
', + }, + // { + // type: 'doc', + // docId: 'overview', + // position: 'left', + // label: 'Overview', + // }, + // { + // type: 'doc', + // docId: 'intro', + // position: 'left', + // label: 'Getting Started', + // }, + // {to: 'docs/introducing-scribe/what-is-scribe', label: 'What Is Scribe', position: 'left'}, + // {to: 'docs/quick-start/demo', label: 'Quick Start', position: 'left'}, + // {to: 'docs/guides/manag-sbom-and-vul', label: 'Guides', position: 'left'}, + // {to: 'docs/integrating-scribe/ci-integrations', label: 'Integrating with Scribe', position: 'left'}, + // {to: 'docs/advanced-guide/standalone-deployment', label: 'Advanced Guide', position: 'left'}, + // {to: 'docs/scribe-hub-reports', label: 'Scribe Hub Reports', position: 'left'}, + // {to: 'docs/scribe-api', label: 'Scribe API', position: 'left'}, + // { + // type: 'doc', + // docId: 'sampleproject', + // position: 'left', + // label: 'Sample Project', + // }, + // { + // type: 'doc', + // docId: 'cves', + // position: 'left', + // label: 'Detecting CVEs', + // }, + // { + // type: 'doc', + // docId: 'readingoutput', + // position: 'left', + // label: 'Reading Analysis', + // }, + // { + // type: 'doc', + // docId: 'cveReports', + // position: 'left', + // label: 'CVE Reports', + // }, + // { + // type: 'doc', + // docId: 'glossary', + // position: 'left', + // label: 'Glossary', + // } + // {to: '/blog', label: 'Blog', position: 'left'}, + // { + // href: 'https://github.com/facebook/docusaurus', + // label: 'GitHub', + // position: 'right', + // }, + ], + }, + // footer: { + // style: 'dark', + // links: [ + // { + // title: 'Docs', + // items: [ + // { + // label: 'Tutorial', + // to: '/docs/intro', + // }, + // ], + // }, + // { + // title: 'Community', + // items: [ + // { + // label: 'Stack Overflow', + // href: 'https://stackoverflow.com/questions/tagged/docusaurus', + // }, + // { + // label: 'Discord', + // href: 'https://discordapp.com/invite/docusaurus', + // }, + // { + // label: 'Twitter', + // href: 'https://twitter.com/docusaurus', + // }, + // ], + // }, + // { + // title: 'More', + // items: [ + // { + // label: 'GitHub', + // href: 'https://github.com/facebook/docusaurus', + // }, + // ], + // }, + // ], + // copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, + // }, + prism: { + theme: lightCodeTheme, + darkTheme: darkCodeTheme, + }, + }), }; -module.exports = config; +module.exports = config; \ No newline at end of file From 7f7e6017183c9d9d3fefc98dbd8eed9fb4921e30 Mon Sep 17 00:00:00 2001 From: timurscribe Date: Tue, 9 Sep 2025 14:07:56 +0300 Subject: [PATCH 2/2] fix: improve branch resolution and environment variable handling in docusaurus config --- docusaurus.config.js | 505 ++++++++++++++++++++++--------------------- 1 file changed, 258 insertions(+), 247 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index cd787634..41836b3f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -4,11 +4,18 @@ const {themes} = require('prism-react-renderer'); const lightCodeTheme = themes.github; const darkCodeTheme = themes.dracula; -var branch = require('child_process') - .execSync('git branch --show-current') - .toString().trim(); -branch = branch ? branch : process.env.HEAD?.toString() ?? ""; -var isPullRequest = process.env.PULL_REQUEST === "true"; +// --- FIX: safe branch resolution + env fallback (works without .git) --- +const {execSync} = require('child_process'); +let branch = 'main'; +try { + branch = execSync('git branch --show-current', {stdio: ['ignore','pipe','ignore']}) + .toString().trim() || branch; +} catch { + branch = process.env.HEAD || process.env.GIT_BRANCH || branch; +} +var isPullRequest = String(process.env.PULL_REQUEST || '').toLowerCase() === 'true'; +// Optional: force prod-like includes regardless of branch/PR (useful for submodule builds) +const FORCE_PROD = String(process.env.DOCS_ALWAYS_PROD || '').toLowerCase() === 'true'; // console.log(process.env); /** @type {import('@docusaurus/types').Config} */ @@ -25,7 +32,7 @@ const config = { plugins: [ require.resolve('docusaurus-lunr-search'), [ - '@docusaurus/plugin-sitemap', + '@docusaurus/plugin-sitemap', { id: 'sitemap', changefreq: 'weekly', @@ -44,7 +51,7 @@ const config = { // existingPath.replace('/advanced-guide/ssc-regulations/ssdfpolicies', '/ssdfpolicies'), // existingPath.replace('/advanced-guide/ssc-regulations/slsapolicies', '/slsapolicies'), // ]; - // } + // } // } // } // ] @@ -53,7 +60,7 @@ const config = { title: 'The Scribe Documentation Site', tagline: 'Four legs good. Two legs bad.', url: 'https://profound-wisp-8a86b9.netlify.app/', - baseUrl: process?.env?.DOCUSAURUS_BASE_URL || '/', //onBrokenLinks: 'throw', + baseUrl: process.env.DOCUSAURUS_BASE_URL || '/', //onBrokenLinks: 'throw', onBrokenLinks: 'warn', onBrokenMarkdownLinks: 'warn', favicon: 'img/favicon.ico', @@ -77,118 +84,122 @@ const config = { ({ docs: { include: [ - ...((isPullRequest && branch.includes("dev-preview") || - (!isPullRequest && branch == "dev") )) ? [ + ...( + // --- FIX: allow forcing prod list via env; otherwise keep your original logic --- + !FORCE_PROD && ( + (isPullRequest && branch.includes("dev-preview") || + (!isPullRequest && branch == "dev")) + ) + ) ? [ '**/*.md', - ] : [ - "introducing-scribe/what-is-scribe.md", - "introducing-scribe/scribe-hub.md", - "introducing-scribe/stand-alone.md", - "quick-start/README.md", - "guides/manag-sbom-and-vul.md", - "guides/secure-sfw-slsa/README.md", - "guides/secure-sfw-slsa/slsa-lvl-1.md", - "guides/secure-sfw-slsa/slsa-lvl-2.md", - "guides/secure-sfw-slsa/slsa-on-scale.md", - "guides/secure-sfw-slsa/slsa-lvl-3.md", - "guides/secure-sfw-slsa/customizing-provenance.md", - "guides/secure-sfw-slsa/basic-examples.md", - // "guides/secure-sfw-slsa/cosign-keyverno.md", - "guides/secure-sfw-slsa/slsapolicies.md", - "guides/enforcing-sdlc-initiative.md", - "guides/ssdf-compliance/README.md", - "guides/ssdf-compliance/ssdfpolicies.md", - "guides/enforcing-sdlc-policy.md", - "guides/securing-builds.md", - "integrating-scribe/ci-integrations/README.md", - "integrating-scribe/ci-integrations/github/github.md", - "integrating-scribe/ci-integrations/github/action-slsa.md", - "integrating-scribe/ci-integrations/github/action-bom.md", - "integrating-scribe/ci-integrations/github/action-verify.md", - "integrating-scribe/ci-integrations/github/action-evidence.md", - "integrating-scribe/ci-integrations/github/action-installer.md", - "integrating-scribe/ci-integrations/jenkins.md", - "integrating-scribe/ci-integrations/example.md", - "integrating-scribe/ci-integrations/general.md", - "integrating-scribe/ci-integrations/azure.md", - "integrating-scribe/ci-integrations/bitbucket.md", - "integrating-scribe/ci-integrations/circleci.md", - "integrating-scribe/ci-integrations/gitlabci.md", - "integrating-scribe/ci-integrations/travis.md", - "integrating-scribe/ci-integrations/tekton.md", - "integrating-scribe/ci-integrations/valint-ci-configuration.md", - "integrating-scribe/other-evidence-stores.md", - "integrating-scribe/vulnerability-scanners.md", - "integrating-scribe/jira.md", - // "integrating-scribe/git-repositories.md", - // "integrating-scribe/package-repositories.md", - "valint/README.md", - "valint/overview.md", - "valint/getting-started-valint.md", - "valint/attestations.md", - "valint/generic.md", - "valint/pram_summary.md", - "valint/policy-results.md", - "valint/policies.md", - "valint/sbom.md", - "valint/cosign.md", - "valint/configuration.md", - "valint/pram_summary.md", - "valint/help/reference.md", - "valint/help/valint.md", - "valint/help/valint_bom.md", - "valint/help/valint_verify.md", - "valint/help/valint_slsa.md", - "valint/help/valint_list.md", - "valint/help/valint_discard.md", - "valint/help/valint_download.md", - "valint/help/valint_evidence.md", - "valint/initiatives.md", - "integrating-scribe/admission-controller/gatekeeper-provider.md", - "integrating-scribe/admission-controller/kyverno.md", - "scribe-hub-reports/README.md", - "scribe-hub-reports/product.md", - "scribe-hub-reports/compliance.md", - "scribe-hub-reports/context.md", - // "scribe-hub-reports/evidence.md", - "scribe-hub-reports/advisories.md", - "scribe-hub-reports/investigation.md", - "scribe-hub-reports/licenses.md", - "scribe-hub-reports/sbom.md", - "scribe-hub-reports/vulnerabilities.md", - "scribe-api/README.md", - "platforms/gitlab-integration.md", - "platforms/github-integration.md", - "platforms/jenkins-integration.md", - "platforms/overview.md", - "platforms/discover.md", - "platforms/bom.md", - "platforms/evidence.md", - "platforms/verify.md", - "platforms/generate_k8s_token.md", - "platforms/usage.md", - "platforms/hooks.md", - "release-notes/rns.md", - "configuration/**/*.md", - "configuration/*.md", + ] : [ + "introducing-scribe/what-is-scribe.md", + "introducing-scribe/scribe-hub.md", + "introducing-scribe/stand-alone.md", + "quick-start/README.md", + "guides/manag-sbom-and-vul.md", + "guides/secure-sfw-slsa/README.md", + "guides/secure-sfw-slsa/slsa-lvl-1.md", + "guides/secure-sfw-slsa/slsa-lvl-2.md", + "guides/secure-sfw-slsa/slsa-on-scale.md", + "guides/secure-sfw-slsa/slsa-lvl-3.md", + "guides/secure-sfw-slsa/customizing-provenance.md", + "guides/secure-sfw-slsa/basic-examples.md", + // "guides/secure-sfw-slsa/cosign-keyverno.md", + "guides/secure-sfw-slsa/slsapolicies.md", + "guides/enforcing-sdlc-initiative.md", + "guides/ssdf-compliance/README.md", + "guides/ssdf-compliance/ssdfpolicies.md", + "guides/enforcing-sdlc-policy.md", + "guides/securing-builds.md", + "integrating-scribe/ci-integrations/README.md", + "integrating-scribe/ci-integrations/github/github.md", + "integrating-scribe/ci-integrations/github/action-slsa.md", + "integrating-scribe/ci-integrations/github/action-bom.md", + "integrating-scribe/ci-integrations/github/action-verify.md", + "integrating-scribe/ci-integrations/github/action-evidence.md", + "integrating-scribe/ci-integrations/github/action-installer.md", + "integrating-scribe/ci-integrations/jenkins.md", + "integrating-scribe/ci-integrations/example.md", + "integrating-scribe/ci-integrations/general.md", + "integrating-scribe/ci-integrations/azure.md", + "integrating-scribe/ci-integrations/bitbucket.md", + "integrating-scribe/ci-integrations/circleci.md", + "integrating-scribe/ci-integrations/gitlabci.md", + "integrating-scribe/ci-integrations/travis.md", + "integrating-scribe/ci-integrations/tekton.md", + "integrating-scribe/ci-integrations/valint-ci-configuration.md", + "integrating-scribe/other-evidence-stores.md", + "integrating-scribe/vulnerability-scanners.md", + "integrating-scribe/jira.md", + // "integrating-scribe/git-repositories.md", + // "integrating-scribe/package-repositories.md", + "valint/README.md", + "valint/overview.md", + "valint/getting-started-valint.md", + "valint/attestations.md", + "valint/generic.md", + "valint/pram_summary.md", + "valint/policy-results.md", + "valint/policies.md", + "valint/sbom.md", + "valint/cosign.md", + "valint/configuration.md", + "valint/pram_summary.md", + "valint/help/reference.md", + "valint/help/valint.md", + "valint/help/valint_bom.md", + "valint/help/valint_verify.md", + "valint/help/valint_slsa.md", + "valint/help/valint_list.md", + "valint/help/valint_discard.md", + "valint/help/valint_download.md", + "valint/help/valint_evidence.md", + "valint/initiatives.md", + "integrating-scribe/admission-controller/gatekeeper-provider.md", + "integrating-scribe/admission-controller/kyverno.md", + "scribe-hub-reports/README.md", + "scribe-hub-reports/product.md", + "scribe-hub-reports/compliance.md", + "scribe-hub-reports/context.md", + // "scribe-hub-reports/evidence.md", + "scribe-hub-reports/advisories.md", + "scribe-hub-reports/investigation.md", + "scribe-hub-reports/licenses.md", + "scribe-hub-reports/sbom.md", + "scribe-hub-reports/vulnerabilities.md", + "scribe-api/README.md", + "platforms/gitlab-integration.md", + "platforms/github-integration.md", + "platforms/jenkins-integration.md", + "platforms/overview.md", + "platforms/discover.md", + "platforms/bom.md", + "platforms/evidence.md", + "platforms/verify.md", + "platforms/generate_k8s_token.md", + "platforms/usage.md", + "platforms/hooks.md", + "release-notes/rns.md", + "configuration/**/*.md", + "configuration/*.md", - - // "advanced-guide/generating-sboms.md", - // "advanced-guide/source-code-integrity.md", - // "advanced-guide/standalone-deployment/README.md", - // "advanced-guide/standalone-deployment/signVerify.md", - // "advanced-guide/standalone-deployment/action-bom.md", - // "advanced-guide/standalone-deployment/action-verify.md", - // "advanced-guide/standalone-deployment/action-installer.md", - // "advanced-guide/standalone-deployment.md", - // "advanced-guide/action-bom.md", - // "advanced-guide/action-verify.md", - // "advanced-guide/action-installer.md", - // "advanced-guide/ssc-regulations/README.md", - // "advanced-guide/ssc-regulations/slsapolicies.md", - // "advanced-guide/ssc-regulations/ssdfpolicies.md" - ], + // "advanced-guide/generating-sboms.md", + // "advanced-guide/source-code-integrity.md", + // "advanced-guide/standalone-deployment/README.md", + // "advanced-guide/standalone-deployment/signVerify.md", + // "advanced-guide/standalone-deployment/action-bom.md", + // "advanced-guide/standalone-deployment/action-verify.md", + // "advanced-guide/standalone-deployment/action-installer.md", + // "advanced-guide/standalone-deployment.md", + // "advanced-guide/action-bom.md", + // "advanced-guide/action-verify.md", + // "advanced-guide/action-installer.md", + // "advanced-guide/ssc-regulations/README.md", + // "advanced-guide/ssc-regulations/slsapolicies.md", + // "advanced-guide/ssc-regulations/ssdfpolicies.md" ], + ], sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. // Remove this to remove the "edit this page" links. @@ -205,137 +216,137 @@ const config = { ], themeConfig: - /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ - ({ - // announcementBar: { - // id: 'new_documentation', - // content: - // 'The new Scribe documentation website is live!', - // backgroundColor: '#fafbfc', - // textColor: '#091E42', - // isCloseable: false, - // }, - tableOfContents: { - minHeadingLevel: 2, - maxHeadingLevel: 5, - }, - navbar: { - // title: 'My Site', - logo: { - alt: 'Scribe Security Logo', - src: 'img/Scribe_dark.svg', - srcDark: 'img/Scribe_white.svg', - href: 'https://scribesecurity.com/', - }, - items: [ - { - type: 'html', - position: 'right', - value: '
', - }, - // { - // type: 'doc', - // docId: 'overview', - // position: 'left', - // label: 'Overview', - // }, - // { - // type: 'doc', - // docId: 'intro', - // position: 'left', - // label: 'Getting Started', - // }, - // {to: 'docs/introducing-scribe/what-is-scribe', label: 'What Is Scribe', position: 'left'}, - // {to: 'docs/quick-start/demo', label: 'Quick Start', position: 'left'}, - // {to: 'docs/guides/manag-sbom-and-vul', label: 'Guides', position: 'left'}, - // {to: 'docs/integrating-scribe/ci-integrations', label: 'Integrating with Scribe', position: 'left'}, - // {to: 'docs/advanced-guide/standalone-deployment', label: 'Advanced Guide', position: 'left'}, - // {to: 'docs/scribe-hub-reports', label: 'Scribe Hub Reports', position: 'left'}, - // {to: 'docs/scribe-api', label: 'Scribe API', position: 'left'}, - // { - // type: 'doc', - // docId: 'sampleproject', - // position: 'left', - // label: 'Sample Project', - // }, - // { - // type: 'doc', - // docId: 'cves', - // position: 'left', - // label: 'Detecting CVEs', - // }, - // { - // type: 'doc', - // docId: 'readingoutput', - // position: 'left', - // label: 'Reading Analysis', - // }, - // { - // type: 'doc', - // docId: 'cveReports', - // position: 'left', - // label: 'CVE Reports', + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + // announcementBar: { + // id: 'new_documentation', + // content: + // 'The new Scribe documentation website is live!', + // backgroundColor: '#fafbfc', + // textColor: '#091E42', + // isCloseable: false, // }, - // { - // type: 'doc', - // docId: 'glossary', - // position: 'left', - // label: 'Glossary', - // } - // {to: '/blog', label: 'Blog', position: 'left'}, - // { - // href: 'https://github.com/facebook/docusaurus', - // label: 'GitHub', - // position: 'right', + tableOfContents: { + minHeadingLevel: 2, + maxHeadingLevel: 5, + }, + navbar: { + // title: 'My Site', + logo: { + alt: 'Scribe Security Logo', + src: 'img/Scribe_dark.svg', + srcDark: 'img/Scribe_white.svg', + href: 'https://scribesecurity.com/', + }, + items: [ + { + type: 'html', + position: 'right', + value: '
', + }, + // { + // type: 'doc', + // docId: 'overview', + // position: 'left', + // label: 'Overview', + // }, + // { + // type: 'doc', + // docId: 'intro', + // position: 'left', + // label: 'Getting Started', + // }, + // {to: 'docs/introducing-scribe/what-is-scribe', label: 'What Is Scribe', position: 'left'}, + // {to: 'docs/quick-start/demo', label: 'Quick Start', position: 'left'}, + // {to: 'docs/guides/manag-sbom-and-vul', label: 'Guides', position: 'left'}, + // {to: 'docs/integrating-scribe/ci-integrations', label: 'Integrating with Scribe', position: 'left'}, + // {to: 'docs/advanced-guide/standalone-deployment', label: 'Advanced Guide', position: 'left'}, + // {to: 'docs/scribe-hub-reports', label: 'Scribe Hub Reports', position: 'left'}, + // {to: 'docs/scribe-api', label: 'Scribe API', position: 'left'}, + // { + // type: 'doc', + // docId: 'sampleproject', + // position: 'left', + // label: 'Sample Project', + // }, + // { + // type: 'doc', + // docId: 'cves', + // position: 'left', + // label: 'Detecting CVEs', + // }, + // { + // type: 'doc', + // docId: 'readingoutput', + // position: 'left', + // label: 'Reading Analysis', + // }, + // { + // type: 'doc', + // docId: 'cveReports', + // position: 'left', + // label: 'CVE Reports', + // }, + // { + // type: 'doc', + // docId: 'glossary', + // position: 'left', + // label: 'Glossary', + // } + // {to: '/blog', label: 'Blog', position: 'left'}, + // { + // href: 'https://github.com/facebook/docusaurus', + // label: 'GitHub', + // position: 'right', + // }, + ], + }, + // footer: { + // style: 'dark', + // links: [ + // { + // title: 'Docs', + // items: [ + // { + // label: 'Tutorial', + // to: '/docs/intro', + // }, + // ], + // }, + // { + // title: 'Community', + // items: [ + // { + // label: 'Stack Overflow', + // href: 'https://stackoverflow.com/questions/tagged/docusaurus', + // }, + // { + // label: 'Discord', + // href: 'https://discordapp.com/invite/docusaurus', + // }, + // { + // label: 'Twitter', + // href: 'https://twitter.com/docusaurus', + // }, + // ], + // }, + // { + // title: 'More', + // items: [ + // { + // label: 'GitHub', + // href: 'https://github.com/facebook/docusaurus', + // }, + // ], + // }, + // ], + // copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, // }, - ], - }, - // footer: { - // style: 'dark', - // links: [ - // { - // title: 'Docs', - // items: [ - // { - // label: 'Tutorial', - // to: '/docs/intro', - // }, - // ], - // }, - // { - // title: 'Community', - // items: [ - // { - // label: 'Stack Overflow', - // href: 'https://stackoverflow.com/questions/tagged/docusaurus', - // }, - // { - // label: 'Discord', - // href: 'https://discordapp.com/invite/docusaurus', - // }, - // { - // label: 'Twitter', - // href: 'https://twitter.com/docusaurus', - // }, - // ], - // }, - // { - // title: 'More', - // items: [ - // { - // label: 'GitHub', - // href: 'https://github.com/facebook/docusaurus', - // }, - // ], - // }, - // ], - // copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, - // }, - prism: { - theme: lightCodeTheme, - darkTheme: darkCodeTheme, - }, - }), + prism: { + theme: lightCodeTheme, + darkTheme: darkCodeTheme, + }, + }), }; -module.exports = config; +module.exports = config; \ No newline at end of file