diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 226eeb17845..31bea6a091a 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -3,7 +3,6 @@ name: PullRequestCI env: # Force the stdout and stderr streams to be unbuffered PYTHONUNBUFFERED: 1 - CI: false on: # yamllint disable-line rule:truthy pull_request: @@ -34,4 +33,33 @@ jobs: run: yarn install --frozen-lockfile - name: Build - run: yarn build + id: build + continue-on-error: true + run: | + CI=false DOCUSAURUS_IGNORE_SSG_WARNINGS=true yarn build + echo "exit_code=$?" >> $GITHUB_OUTPUT + + - name: Check for validation failures + if: success() || failure() # Run regardless of build success + run: | + FAILED=false + + if [ -f ".frontmatter-validation-failed" ]; then + echo "::error::Frontmatter validation failed" + FAILED=true + fi + + if [ -f ".floating-pages-validation-failed" ]; then + echo "::error::Floating pages validation failed" + FAILED=true + fi + + # Check if build failed with non-validation error + if [ "${{ steps.build.outputs.exit_code }}" != "0" ] && [ "$FAILED" != "true" ]; then + echo "::error::Build failed with exit code ${{ steps.build.outputs.exit_code }}" + exit 1 + fi + + if [ "$FAILED" = true ]; then + exit 1 + fi diff --git a/docs/integrations/data-ingestion/clickpipes/aws-privatelink.md b/docs/integrations/data-ingestion/clickpipes/aws-privatelink.md index b4000abd596..eabfe8f2f60 100644 --- a/docs/integrations/data-ingestion/clickpipes/aws-privatelink.md +++ b/docs/integrations/data-ingestion/clickpipes/aws-privatelink.md @@ -1,8 +1,8 @@ --- -sidebar_label: "AWS PrivateLink for ClickPipes" -description: "Establish a secure connection between ClickPipes and a data source using AWS PrivateLink." +sidebar_label: 'AWS PrivateLink for ClickPipes' +description: 'Establish a secure connection between ClickPipes and a data source using AWS PrivateLink.' slug: /integrations/clickpipes/aws-privatelink -title: "AWS PrivateLink for ClickPipes" +title: 'AWS PrivateLink for ClickPipes' --- import cp_service from '@site/static/images/integrations/data-ingestion/clickpipes/cp_service.png'; diff --git a/plugins/checkFloatingPages.js b/plugins/checkFloatingPages.js index 3ba5454d4af..9e5ad720c80 100644 --- a/plugins/checkFloatingPages.js +++ b/plugins/checkFloatingPages.js @@ -94,7 +94,15 @@ async function checkFloatingPages(context, options = {}) { if (options && options.failBuild) { console.error('\x1b[31m%s\x1b[0m', `${floatingPages.length} floating pages found:`); floatingPages.forEach(page => console.error(` - ${page}`)); - throw new Error('Error: Found "floating" pages without sidebars. For further details see: https://github.com/ClickHouse/clickhouse-docs/blob/main/contribute/style-guide.md/'); + console.error('Error: Found "floating" pages without sidebars. For further details see: https://github.com/ClickHouse/clickhouse-docs/blob/main/contribute/style-guide.md/'); + + // Create a signal file + fs.writeFileSync( + path.join(process.cwd(), 'floating-pages-validation-failed'), + 'Floating pages validation failed' + ); + + process.exit(1); } else { console.log('Warning:', 'Found floating pages:'); floatingPages.forEach(page => console.log(` - ${page}`)); diff --git a/plugins/frontmatter-validation/frontmatterValidatorPlugin.js b/plugins/frontmatter-validation/frontmatterValidatorPlugin.js index e2b3a7102ad..9cf9093108e 100644 --- a/plugins/frontmatter-validation/frontmatterValidatorPlugin.js +++ b/plugins/frontmatter-validation/frontmatterValidatorPlugin.js @@ -16,10 +16,10 @@ function frontmatterValidatorPlugin(context, options) { resetIssues(); }, - // Check for issues after the build + // Check for issues async postBuild({ outDir }) { const filesWithIssues = getFilesWithIssues(); - + if (filesWithIssues.length > 0) { if (options && options.failBuild) { console.error('\n🚨 Build failed: Frontmatter validation issues found'); @@ -45,7 +45,13 @@ function frontmatterValidatorPlugin(context, options) { console.log('See frontmatter-validation-errors.log (when running locally)') // Fail the build by throwing an error - throw new Error('🚨Frontmatter validation failed. For more details see https://github.com/ClickHouse/clickhouse-docs/blob/main/contribute/style-guide.md'); + console.error('🚨Frontmatter validation failed. For more details see https://github.com/ClickHouse/clickhouse-docs/blob/main/contribute/style-guide.md'); + // Create a signal file + fs.writeFileSync( + path.join(process.cwd(), '.frontmatter-validation-failed'), + 'Frontmatter validation failed' + ); + process.exit(1); } else { console.log(`⚠️ Warning: Found ${filesWithIssues.length} files containing problems with frontmatter`) }