From aa7f734b54c3444cdbc59a2f67b02353d6a692f7 Mon Sep 17 00:00:00 2001 From: Eike Waldt Date: Wed, 14 Oct 2026 14:51:08 +0200 Subject: [PATCH] ci: add docs-checks-gate for stable branch protection check Signed-off-by: Eike Waldt On-behalf-of: SAP Assisted-by: Kilo:claude-sonnet-4-6 --- .github/workflows/docs-check.yml | 45 +++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index 1780df5..ad2ca54 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -4,23 +4,60 @@ on: pull_request: branches: [main] types: [opened, synchronize, reopened, closed] - paths: - - 'docs/**' + # No paths: filter — must run on every PR to always produce the gate check push: branches: [main] paths: - 'docs/**' jobs: - docs-checks: - # Skip checks on closed PRs (only need the notification) + 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 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]