|
1 | 1 | name: Docs quality sweep |
| 2 | +# Master dispatcher. Fans out to seven independent sub-workflows via |
| 3 | +# `gh workflow run`. We can't use `workflow_call` here because gh-aw |
| 4 | +# v0.71.x compiles a single artifact prefix per orchestrator run |
| 5 | +# (github.workflow + github.run_id), which collides across reusable |
| 6 | +# workflow_call invocations and silently feeds every agent the same |
| 7 | +# prompt. Tracked upstream as github/gh-aw#30338. |
| 8 | +# |
| 9 | +# Kept thin on purpose: only the common "run all" knobs are exposed |
| 10 | +# here. To tune per-sweep settings (target-batch-size, |
| 11 | +# max-per-fix-issue, codespell-args, stale-content thresholds, |
| 12 | +# coherence batch size), dispatch the relevant sub-workflow directly; |
| 13 | +# they're each their own GH workflow now. |
| 14 | + |
2 | 15 | on: |
3 | 16 | workflow_dispatch: |
4 | 17 | inputs: |
5 | 18 | sweeps: |
6 | | - description: "Sweeps to run (comma-separated): frontmatter,applies-to,openings,style,typos,staleness,coherence — or 'all'" |
| 19 | + description: "Sweeps to dispatch (comma-separated): frontmatter,applies-to,openings,style,typos,staleness,coherence — or 'all'" |
7 | 20 | required: false |
8 | 21 | default: "all" |
9 | 22 | source-repo: |
10 | 23 | description: "Repository to scan (owner/repo). Leave empty to scan this repo." |
11 | 24 | required: false |
12 | | - default: "elastic/docs-content" |
| 25 | + default: "" |
13 | 26 | docs-root: |
14 | 27 | description: "Root directory in the source repo (set to '.' for repos where docs live at the root)" |
15 | 28 | required: false |
|
22 | 35 | description: "How to scope the matched markdown files: auto, full, or shard" |
23 | 36 | required: false |
24 | 37 | default: "auto" |
25 | | - target-batch-size: |
26 | | - description: "Approximate pages per rotating slice (Tier 2 sweeps)" |
27 | | - required: false |
28 | | - default: "100" |
29 | | - max-per-fix-issue: |
30 | | - description: "Cap on findings per fix-issue" |
31 | | - required: false |
32 | | - default: "20" |
33 | | - typos-codespell-args: |
34 | | - description: "Extra codespell flags for the typos sweep" |
35 | | - required: false |
36 | | - default: "" |
37 | | - staleness-content-months: |
38 | | - description: "Stale-content threshold (months) for the staleness sweep" |
39 | | - required: false |
40 | | - default: "24" |
41 | | - coherence-batch-size: |
42 | | - description: "Override target-batch-size for the coherence sweep (smaller because comparisons are expensive)" |
43 | | - required: false |
44 | | - default: "50" |
45 | 38 |
|
46 | 39 | permissions: |
47 | | - actions: read |
48 | | - copilot-requests: write |
| 40 | + actions: write # required to dispatch sibling workflows via `gh workflow run` |
49 | 41 | contents: read |
50 | | - discussions: write |
51 | | - issues: write |
52 | | - pull-requests: read |
53 | 42 |
|
54 | 43 | jobs: |
55 | | - frontmatter: |
56 | | - if: contains(inputs.sweeps, 'frontmatter') || inputs.sweeps == 'all' |
57 | | - uses: elastic/docs-actions/.github/workflows/gh-aw-docs-frontmatter-sweep.lock.yml@v1 |
58 | | - with: |
59 | | - source-repo: ${{ inputs.source-repo }} |
60 | | - docs-root: ${{ inputs.docs-root }} |
61 | | - target-path: ${{ inputs.target-path }} |
62 | | - scope-mode: ${{ inputs.scope-mode }} |
63 | | - target-batch-size: ${{ inputs.target-batch-size }} |
64 | | - max-per-fix-issue: ${{ inputs.max-per-fix-issue }} |
65 | | - |
66 | | - applies-to: |
67 | | - if: contains(inputs.sweeps, 'applies-to') || inputs.sweeps == 'all' |
68 | | - uses: elastic/docs-actions/.github/workflows/gh-aw-docs-applies-to-sweep.lock.yml@v1 |
69 | | - with: |
70 | | - source-repo: ${{ inputs.source-repo }} |
71 | | - docs-root: ${{ inputs.docs-root }} |
72 | | - target-path: ${{ inputs.target-path }} |
73 | | - scope-mode: ${{ inputs.scope-mode }} |
74 | | - target-batch-size: ${{ inputs.target-batch-size }} |
75 | | - max-per-fix-issue: ${{ inputs.max-per-fix-issue }} |
76 | | - |
77 | | - openings: |
78 | | - if: contains(inputs.sweeps, 'openings') || inputs.sweeps == 'all' |
79 | | - uses: elastic/docs-actions/.github/workflows/gh-aw-docs-openings-sweep.lock.yml@v1 |
80 | | - with: |
81 | | - source-repo: ${{ inputs.source-repo }} |
82 | | - docs-root: ${{ inputs.docs-root }} |
83 | | - target-path: ${{ inputs.target-path }} |
84 | | - scope-mode: ${{ inputs.scope-mode }} |
85 | | - target-batch-size: ${{ inputs.target-batch-size }} |
86 | | - max-per-fix-issue: ${{ inputs.max-per-fix-issue }} |
87 | | - |
88 | | - style: |
89 | | - if: contains(inputs.sweeps, 'style') || inputs.sweeps == 'all' |
90 | | - uses: elastic/docs-actions/.github/workflows/gh-aw-docs-style-sweep.lock.yml@v1 |
91 | | - with: |
92 | | - source-repo: ${{ inputs.source-repo }} |
93 | | - docs-root: ${{ inputs.docs-root }} |
94 | | - target-path: ${{ inputs.target-path }} |
95 | | - scope-mode: ${{ inputs.scope-mode }} |
96 | | - target-batch-size: ${{ inputs.target-batch-size }} |
97 | | - max-per-fix-issue: ${{ inputs.max-per-fix-issue }} |
| 44 | + fan-out: |
| 45 | + runs-on: ubuntu-latest |
| 46 | + steps: |
| 47 | + - name: Dispatch selected sweeps |
| 48 | + env: |
| 49 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + SWEEPS: ${{ inputs.sweeps }} |
| 51 | + SRC: ${{ inputs.source-repo }} |
| 52 | + ROOT: ${{ inputs.docs-root }} |
| 53 | + TARGET_PATH: ${{ inputs.target-path }} |
| 54 | + SCOPE_MODE: ${{ inputs.scope-mode }} |
| 55 | + run: | |
| 56 | + set -e |
| 57 | + want() { [[ "$SWEEPS" == "all" || "$SWEEPS" == *"$1"* ]]; } |
98 | 58 |
|
99 | | - typos: |
100 | | - if: contains(inputs.sweeps, 'typos') || inputs.sweeps == 'all' |
101 | | - uses: elastic/docs-actions/.github/workflows/gh-aw-docs-typos-sweep.lock.yml@v1 |
102 | | - with: |
103 | | - source-repo: ${{ inputs.source-repo }} |
104 | | - docs-root: ${{ inputs.docs-root }} |
105 | | - target-path: ${{ inputs.target-path }} |
106 | | - scope-mode: ${{ inputs.scope-mode }} |
107 | | - target-batch-size: ${{ inputs.target-batch-size }} |
108 | | - max-per-fix-issue: ${{ inputs.max-per-fix-issue }} |
109 | | - codespell-args: ${{ inputs.typos-codespell-args }} |
| 59 | + fire() { |
| 60 | + local name="$1" |
| 61 | + want "$name" || { echo " skip $name (not in sweeps='$SWEEPS')"; return; } |
| 62 | + echo "→ dispatching docs-${name}-sweep.yml" |
| 63 | + gh workflow run "docs-${name}-sweep.yml" --repo "${{ github.repository }}" \ |
| 64 | + -f source-repo="$SRC" \ |
| 65 | + -f docs-root="$ROOT" \ |
| 66 | + -f target-path="$TARGET_PATH" \ |
| 67 | + -f scope-mode="$SCOPE_MODE" |
| 68 | + } |
110 | 69 |
|
111 | | - staleness: |
112 | | - if: contains(inputs.sweeps, 'staleness') || inputs.sweeps == 'all' |
113 | | - uses: elastic/docs-actions/.github/workflows/gh-aw-docs-staleness-sweep.lock.yml@v1 |
114 | | - with: |
115 | | - source-repo: ${{ inputs.source-repo }} |
116 | | - docs-root: ${{ inputs.docs-root }} |
117 | | - target-path: ${{ inputs.target-path }} |
118 | | - scope-mode: ${{ inputs.scope-mode }} |
119 | | - target-batch-size: ${{ inputs.target-batch-size }} |
120 | | - max-per-fix-issue: ${{ inputs.max-per-fix-issue }} |
121 | | - stale-content-months: ${{ inputs.staleness-content-months }} |
| 70 | + for n in frontmatter applies-to openings style typos staleness coherence; do |
| 71 | + fire "$n" |
| 72 | + done |
122 | 73 |
|
123 | | - coherence: |
124 | | - if: contains(inputs.sweeps, 'coherence') || inputs.sweeps == 'all' |
125 | | - uses: elastic/docs-actions/.github/workflows/gh-aw-docs-coherence-sweep.lock.yml@v1 |
126 | | - with: |
127 | | - source-repo: ${{ inputs.source-repo }} |
128 | | - docs-root: ${{ inputs.docs-root }} |
129 | | - target-path: ${{ inputs.target-path }} |
130 | | - scope-mode: ${{ inputs.scope-mode }} |
131 | | - target-batch-size: ${{ inputs.coherence-batch-size }} |
132 | | - max-per-fix-issue: ${{ inputs.max-per-fix-issue }} |
| 74 | + echo "" |
| 75 | + echo "Each dispatched sweep runs as its own workflow run — see the Actions tab." |
| 76 | + echo "To tune per-sweep settings (batch size, caps, thresholds), dispatch the sub-workflow directly." |
0 commit comments