|
1 | 1 | name: Documentation Quality Check |
2 | 2 |
|
| 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 | + |
3 | 9 | on: |
4 | 10 | pull_request: |
5 | 11 | branches: [main] |
6 | 12 | types: [opened, synchronize, reopened, closed] |
7 | | - paths: |
8 | | - - 'docs/**' |
9 | 13 | push: |
10 | 14 | branches: [main] |
11 | | - paths: |
12 | | - - 'docs/**' |
13 | 15 |
|
14 | 16 | jobs: |
15 | | - docs-checks: |
16 | | - # Skip checks on closed PRs (only need the notification) |
17 | | - if: github.event_name != 'pull_request' || github.event.action != 'closed' |
18 | | - uses: gardenlinux/docs/.github/workflows/docs-checks.yml@main |
| 17 | + docs: |
| 18 | + uses: gardenlinux/docs/.github/workflows/aggregated-repo-docs.yml@main |
19 | 19 | with: |
20 | | - override-repo: ${{ github.event.repository.name }} |
21 | | - override-ref: ${{ github.head_ref || github.ref_name }} |
22 | | - override-commit: ${{ github.event.pull_request.head.sha || github.sha }} |
23 | | - |
24 | | - notify-docs: |
25 | | - name: Notify docs |
26 | | - needs: [docs-checks] |
27 | | - runs-on: ubuntu-24.04 |
28 | | - # Only notify for PR events (not push events which lack PR context) |
29 | | - # Run after checks pass for open PRs, OR immediately for merged PRs |
30 | | - if: | |
31 | | - always() && |
32 | | - github.event_name == 'pull_request' && |
33 | | - ( |
34 | | - (github.event.action == 'closed' && github.event.pull_request.merged == true) || |
35 | | - (github.event.action != 'closed' && needs.docs-checks.result == 'success') |
36 | | - ) |
37 | | - steps: |
38 | | - - name: Generate GitHub App token |
39 | | - id: app-token |
40 | | - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 |
41 | | - with: |
42 | | - app-id: ${{ secrets.DOCS_BOT_APP_ID }} |
43 | | - private-key: ${{ secrets.DOCS_BOT_PRIVATE_KEY }} |
44 | | - repositories: docs |
45 | | - |
46 | | - - name: Send repository dispatch to docs |
47 | | - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
48 | | - with: |
49 | | - github-token: ${{ steps.app-token.outputs.token }} |
50 | | - script: | |
51 | | - const isMergedPR = context.payload.action === 'closed' && |
52 | | - context.payload.pull_request.merged === true; |
53 | | -
|
54 | | - // For merged PRs, use the base branch (the branch it was merged into) |
55 | | - // For open PRs, use the head branch (feature branch) |
56 | | - const ref = isMergedPR |
57 | | - ? context.payload.pull_request.base.ref |
58 | | - : context.payload.pull_request.head.ref; |
59 | | -
|
60 | | - await github.rest.repos.createDispatchEvent({ |
61 | | - owner: 'gardenlinux', |
62 | | - repo: 'docs', |
63 | | - event_type: 'docs-pr', |
64 | | - client_payload: { |
65 | | - repo: '${{ github.event.repository.name }}', |
66 | | - pr_number: `${context.payload.pull_request.number}`, |
67 | | - commit_sha: isMergedPR |
68 | | - ? context.payload.pull_request.merge_commit_sha |
69 | | - : context.payload.pull_request.head.sha, |
70 | | - ref: ref, |
71 | | - event: isMergedPR ? 'merged' : 'pr_success' |
72 | | - } |
73 | | - }); |
74 | | - core.info('Repository dispatch sent to docs'); |
| 20 | + repo: package-linux |
| 21 | + secrets: inherit |
0 commit comments