From 3aa44f4cb289a4a1b126be1897efc9d3952600fe Mon Sep 17 00:00:00 2001 From: yeoldegrove Date: Tue, 27 Oct 2026 15:08:37 +0100 Subject: [PATCH] ci: use shared docs CI orchestrator in docs-check Replace the duplicated detect-changes/docs-checks/gate/notify-docs logic with a thin caller of gardenlinux/docs aggregated-repo-docs.yml. The orchestrator decides documentation paths from repos-config.json, so this repository no longer creates a docs preview PR for merges that do not touch documentation paths. Signed-off-by: Eike Waldt On-behalf-of: SAP Assisted-by: Kilo:claude-sonnet-4-6 --- .github/workflows/docs-check.yml | 110 +++---------------------------- 1 file changed, 10 insertions(+), 100 deletions(-) diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index ad2ca54..012a552 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -1,111 +1,21 @@ name: Documentation Quality Check +# Thin caller for the documentation CI orchestrator in gardenlinux/docs. +# +# All documentation-path logic and the notify/commit-lock decision live in +# gardenlinux/docs/.github/workflows/aggregated-repo-docs.yml, which uses +# repos-config.json as the single source of truth for documentation paths. + on: pull_request: branches: [main] types: [opened, synchronize, reopened, closed] - # No paths: filter — must run on every PR to always produce the gate check push: branches: [main] - paths: - - 'docs/**' jobs: - detect-changes: - name: Detect docs path changes - # Skip on closed PRs (only need the notification) and push events (handled by paths: above) - if: github.event_name != 'pull_request' || github.event.action != 'closed' - runs-on: ubuntu-24.04 - outputs: - docs: ${{ steps.filter.outputs.docs }} - steps: - - uses: actions/checkout@v4 - - name: Check for docs path changes - id: filter - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 - with: - filters: | - docs: - - 'docs/**' - - docs-checks: - needs: [detect-changes] - if: needs.detect-changes.outputs.docs == 'true' - uses: gardenlinux/docs/.github/workflows/docs-checks.yml@main + docs: + uses: gardenlinux/docs/.github/workflows/aggregated-repo-docs.yml@main with: - override-repo: ${{ github.event.repository.name }} - override-ref: ${{ github.head_ref || github.ref_name }} - override-commit: ${{ github.event.pull_request.head.sha || github.sha }} - - docs-checks-gate: - name: Docs checks gate - needs: [detect-changes, docs-checks] - if: always() && (github.event_name != 'pull_request' || github.event.action != 'closed') - runs-on: ubuntu-24.04 - steps: - - name: Evaluate docs checks result - run: | - DOCS_CHANGED="${{ needs.detect-changes.outputs.docs }}" - DOCS_RESULT="${{ needs.docs-checks.result }}" - if [[ "$DOCS_CHANGED" != "true" ]]; then - echo "Docs paths not changed; skipping docs checks — gate passes." - exit 0 - fi - if [[ "$DOCS_RESULT" == "success" ]]; then - echo "Docs checks passed." - exit 0 - fi - echo "Docs checks result: $DOCS_RESULT" - exit 1 - - notify-docs: - name: Notify docs - needs: [docs-checks] - runs-on: ubuntu-24.04 - # Only notify for PR events (not push events which lack PR context) - # Run after checks pass for open PRs, OR immediately for merged PRs - if: | - always() && - github.event_name == 'pull_request' && - ( - (github.event.action == 'closed' && github.event.pull_request.merged == true) || - (github.event.action != 'closed' && needs.docs-checks.result == 'success') - ) - steps: - - name: Generate GitHub App token - id: app-token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - with: - app-id: ${{ secrets.DOCS_BOT_APP_ID }} - private-key: ${{ secrets.DOCS_BOT_PRIVATE_KEY }} - repositories: docs - - - name: Send repository dispatch to docs - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ steps.app-token.outputs.token }} - script: | - const isMergedPR = context.payload.action === 'closed' && - context.payload.pull_request.merged === true; - - // For merged PRs, use the base branch (the branch it was merged into) - // For open PRs, use the head branch (feature branch) - const ref = isMergedPR - ? context.payload.pull_request.base.ref - : context.payload.pull_request.head.ref; - - await github.rest.repos.createDispatchEvent({ - owner: 'gardenlinux', - repo: 'docs', - event_type: 'docs-pr', - client_payload: { - repo: '${{ github.event.repository.name }}', - pr_number: `${context.payload.pull_request.number}`, - commit_sha: isMergedPR - ? context.payload.pull_request.merge_commit_sha - : context.payload.pull_request.head.sha, - ref: ref, - event: isMergedPR ? 'merged' : 'pr_success' - } - }); - core.info('Repository dispatch sent to docs'); + repo: glrd + secrets: inherit