diff --git a/action.yml b/action.yml index 719993d..29baecc 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,9 @@ inputs: docs-path: description: 'Path to docs directory in calling repo' default: 'docs' + on-broken-links: + description: 'Behavior on broken links: throw, warn, or ignore' + default: 'throw' runs: using: 'composite' @@ -56,6 +59,8 @@ runs: - name: Build docs shell: bash working-directory: ${{ github.action_path }}/docusaurus + env: + DOCUSERVIX_ON_BROKEN_LINKS: ${{ inputs.on-broken-links }} run: yarn docusaurus build --out-dir ${{ github.workspace }}/generated-docs - name: Upload to S3 diff --git a/docusaurus/docusaurus.config.ts b/docusaurus/docusaurus.config.ts index 271459a..be6b605 100644 --- a/docusaurus/docusaurus.config.ts +++ b/docusaurus/docusaurus.config.ts @@ -30,6 +30,7 @@ const { } = docsConfig.dirs || {} const giteaUrl = 'https://git.jt4d.ru'; +const onBrokenLinks = (process.env.DOCUSERVIX_ON_BROKEN_LINKS as Config['onBrokenLinks']) || 'throw'; const config: Config = { title, @@ -56,7 +57,7 @@ const config: Config = { organizationName: org, projectName: repo, - onBrokenLinks: 'throw', + onBrokenLinks, // Even if you don't use internationalization, you can use this field to set // useful metadata like html lang. For example, if your site is Chinese, you