Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading