Skip to content

Commit 6ce434b

Browse files
committed
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 <waldt@b1-systems.de> On-behalf-of: SAP <eike.waldt@sap.com> Assisted-by: Kilo:claude-sonnet-4-6
1 parent 3080f5f commit 6ce434b

1 file changed

Lines changed: 10 additions & 100 deletions

File tree

‎.github/workflows/docs-check.yml‎

Lines changed: 10 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,21 @@
11
name: Documentation Quality Check
22

3+
# Thin caller for the documentation CI orchestrator in gardenlinux/docs.
4+
#
5+
# All documentation-path logic and the notify/commit-lock decision live in
6+
# gardenlinux/docs/.github/workflows/aggregated-repo-docs.yml, which uses
7+
# repos-config.json as the single source of truth for documentation paths.
8+
39
on:
410
pull_request:
511
branches: [main]
612
types: [opened, synchronize, reopened, closed]
7-
# No paths: filter — must run on every PR to always produce the gate check
813
push:
914
branches: [main]
10-
paths:
11-
- 'docs/**'
1215

1316
jobs:
14-
detect-changes:
15-
name: Detect docs path changes
16-
# Skip on closed PRs (only need the notification) and push events (handled by paths: above)
17-
if: github.event_name != 'pull_request' || github.event.action != 'closed'
18-
runs-on: ubuntu-24.04
19-
outputs:
20-
docs: ${{ steps.filter.outputs.docs }}
21-
steps:
22-
- uses: actions/checkout@v7
23-
- name: Check for docs path changes
24-
id: filter
25-
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
26-
with:
27-
filters: |
28-
docs:
29-
- 'docs/**'
30-
31-
docs-checks:
32-
needs: [detect-changes]
33-
if: needs.detect-changes.outputs.docs == 'true'
34-
uses: gardenlinux/docs/.github/workflows/docs-checks.yml@main
17+
docs:
18+
uses: gardenlinux/docs/.github/workflows/aggregated-repo-docs.yml@main
3519
with:
36-
override-repo: ${{ github.event.repository.name }}
37-
override-ref: ${{ github.head_ref || github.ref_name }}
38-
override-commit: ${{ github.event.pull_request.head.sha || github.sha }}
39-
40-
docs-checks-gate:
41-
name: Docs checks gate
42-
needs: [detect-changes, docs-checks]
43-
if: always() && (github.event_name != 'pull_request' || github.event.action != 'closed')
44-
runs-on: ubuntu-24.04
45-
steps:
46-
- name: Evaluate docs checks result
47-
run: |
48-
DOCS_CHANGED="${{ needs.detect-changes.outputs.docs }}"
49-
DOCS_RESULT="${{ needs.docs-checks.result }}"
50-
if [[ "$DOCS_CHANGED" != "true" ]]; then
51-
echo "Docs paths not changed; skipping docs checks — gate passes."
52-
exit 0
53-
fi
54-
if [[ "$DOCS_RESULT" == "success" ]]; then
55-
echo "Docs checks passed."
56-
exit 0
57-
fi
58-
echo "Docs checks result: $DOCS_RESULT"
59-
exit 1
60-
61-
notify-docs:
62-
name: Notify docs
63-
needs: [docs-checks]
64-
runs-on: ubuntu-24.04
65-
# Only notify for PR events (not push events which lack PR context)
66-
# Run after checks pass for open PRs, OR immediately for merged PRs
67-
if: |
68-
always() &&
69-
github.event_name == 'pull_request' &&
70-
(
71-
(github.event.action == 'closed' && github.event.pull_request.merged == true) ||
72-
(github.event.action != 'closed' && needs.docs-checks.result == 'success')
73-
)
74-
steps:
75-
- name: Generate GitHub App token
76-
id: app-token
77-
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
78-
with:
79-
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
80-
private-key: ${{ secrets.DOCS_BOT_PRIVATE_KEY }}
81-
repositories: docs
82-
83-
- name: Send repository dispatch to docs
84-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
85-
with:
86-
github-token: ${{ steps.app-token.outputs.token }}
87-
script: |
88-
const isMergedPR = context.payload.action === 'closed' &&
89-
context.payload.pull_request.merged === true;
90-
91-
// For merged PRs, use the base branch (the branch it was merged into)
92-
// For open PRs, use the head branch (feature branch)
93-
const ref = isMergedPR
94-
? context.payload.pull_request.base.ref
95-
: context.payload.pull_request.head.ref;
96-
97-
await github.rest.repos.createDispatchEvent({
98-
owner: 'gardenlinux',
99-
repo: 'docs',
100-
event_type: 'docs-pr',
101-
client_payload: {
102-
repo: '${{ github.event.repository.name }}',
103-
pr_number: `${context.payload.pull_request.number}`,
104-
commit_sha: isMergedPR
105-
? context.payload.pull_request.merge_commit_sha
106-
: context.payload.pull_request.head.sha,
107-
ref: ref,
108-
event: isMergedPR ? 'merged' : 'pr_success'
109-
}
110-
});
111-
core.info('Repository dispatch sent to docs');
20+
repo: package-build
21+
secrets: inherit

0 commit comments

Comments
 (0)