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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,42 @@ env:
BASE: ghcr.io/hapostgres/pg_auto_failover/pgaf-base:bookworm

jobs:
# ---------------------------------------------------------------------------
# 0. Detect a docs-only change (docs/**, *.md, LICENSE) so the expensive
# build/test jobs below can skip themselves. A *skipped* job still
# reports a "skipped" conclusion under its required-check name, which
# branch protection treats as passing -- unlike a top-level
# push/pull_request `paths-ignore`, which would make the workflow never
# run at all and leave this repo's required status checks permanently
# pending on a docs-only PR.
# ---------------------------------------------------------------------------
check_docs_only:
name: Check if this is a docs-only change
runs-on: ubuntu-latest
outputs:
docs_only: ${{ steps.diff.outputs.docs_only }}
steps:
- uses: actions/checkout@v7.0.0
with:
fetch-depth: 0

- name: Detect docs-only change
id: diff
run: |
BASE_REF="${{ github.event.pull_request.base.sha || 'HEAD~1' }}"
if git diff --name-only "${BASE_REF}"...HEAD | grep -qvE '^(docs/|.*\.md$|LICENSE$)'; then
echo "docs_only=false" >> "$GITHUB_OUTPUT"
else
echo "docs_only=true" >> "$GITHUB_OUTPUT"
fi

# ---------------------------------------------------------------------------
# 1. Style check
# ---------------------------------------------------------------------------
style_checker:
name: Style check
needs: check_docs_only
if: needs.check_docs_only.outputs.docs_only != 'true'
runs-on: ubuntu-latest
container: citus/stylechecker:no-py
steps:
Expand All @@ -58,6 +89,8 @@ jobs:
# ---------------------------------------------------------------------------
check_base_changed:
name: Check if Dockerfile.base changed
needs: check_docs_only
if: needs.check_docs_only.outputs.docs_only != 'true'
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.diff.outputs.changed }}
Expand Down