Skip to content

Commit b7b1810

Browse files
theletterfclaude
andauthored
Sync agentic-workflow example callers with docs-content production versions (#190)
Replace example.yml templates with the versions currently live in elastic/docs-content, which have diverged from the neon-hammer copies: - Switch auth to COPILOT_GITHUB_TOKEN (remove copilot-requests: write) - Generic source-repo/docs-root defaults (empty / ".") - docs-quality-sweep: rewrite as gh workflow run fan-out (avoids artifact-prefix collision in gh-aw ≤0.71, tracked as gh-aw#30338) - docs-coherence-sweep: drop deprecated max-related-per-page input - docs-staleness-sweep: drop stale-screenshot-min-gap-months and lychee-config inputs - docs-typos-sweep: update descriptions, default max-per-fix-issue 50→20 - docs-issue-scope: add workflow_dispatch trigger, update if: condition - issue-triage: expand team ownership mapping with full keyword/path descriptions, add Team:Projects entry - README: update auth guidance to match examples Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d7de6a5 commit b7b1810

11 files changed

Lines changed: 99 additions & 153 deletions

File tree

agentic-workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mkdir -p .github/workflows && curl -sL \
2626
-o .github/workflows/docs-issue-scope.yml
2727
```
2828

29-
These workflows now use the built-in GitHub token path. Add `permissions.copilot-requests: write` to the caller workflow, and do not pass `COPILOT_GITHUB_TOKEN` unless you are intentionally overriding the default auth path.
29+
These workflows use `COPILOT_GITHUB_TOKEN` for authentication. Pass `secrets.COPILOT_GITHUB_TOKEN` from the caller workflow as shown in the `example.yml` files. The quality-sweep orchestrator is the exception — it dispatches sibling workflows via `gh workflow run` and does not pass a token directly.
3030

3131
Skill imports are workflow-specific. Some workflows install APM skills from `elastic/elastic-docs-skills`, while others intentionally rely only on embedded rules and deterministic pre-steps.
3232

agentic-workflows/docs-applies-to-sweep/example.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
source-repo:
66
description: "Repository to scan (owner/repo). Leave empty to scan this repo."
77
required: false
8-
default: "elastic/docs-content"
8+
default: ""
99
docs-root:
1010
description: "Root directory to sweep"
1111
required: false
12-
default: "docs/"
12+
default: "."
1313
target-path:
1414
description: "Optional docs-root-relative directory to sweep recursively (accepts a leading slash)"
1515
required: false
@@ -29,7 +29,6 @@ on:
2929

3030
permissions:
3131
actions: read
32-
copilot-requests: write
3332
contents: read
3433
discussions: write
3534
issues: write
@@ -45,3 +44,5 @@ jobs:
4544
scope-mode: ${{ inputs.scope-mode }}
4645
target-batch-size: ${{ inputs.target-batch-size }}
4746
max-per-fix-issue: ${{ inputs.max-per-fix-issue }}
47+
secrets:
48+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}

agentic-workflows/docs-coherence-sweep/example.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
source-repo:
66
description: "Repository to scan (owner/repo). Leave empty to scan this repo."
77
required: false
8-
default: "elastic/docs-content"
8+
default: ""
99
docs-root:
1010
description: "Root directory to sweep"
1111
required: false
12-
default: "docs/"
12+
default: "."
1313
target-path:
1414
description: "Optional docs-root-relative directory to sweep recursively (accepts a leading slash)"
1515
required: false
@@ -19,21 +19,16 @@ on:
1919
required: false
2020
default: "auto"
2121
target-batch-size:
22-
description: "Approximate pages per rotating slice (keep small — coherence is expensive)"
22+
description: "Pages per rotating slice (smaller — coherence is expensive)"
2323
required: false
2424
default: "50"
2525
max-per-fix-issue:
2626
description: "Cap on findings per fix-issue"
2727
required: false
2828
default: "20"
29-
max-related-per-page:
30-
description: "Cap on related-doc comparisons per in-scope page"
31-
required: false
32-
default: "3"
3329

3430
permissions:
3531
actions: read
36-
copilot-requests: write
3732
contents: read
3833
discussions: write
3934
issues: write
@@ -49,4 +44,5 @@ jobs:
4944
scope-mode: ${{ inputs.scope-mode }}
5045
target-batch-size: ${{ inputs.target-batch-size }}
5146
max-per-fix-issue: ${{ inputs.max-per-fix-issue }}
52-
max-related-per-page: ${{ inputs.max-related-per-page }}
47+
secrets:
48+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}

agentic-workflows/docs-frontmatter-sweep/example.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
source-repo:
66
description: "Repository to scan (owner/repo). Leave empty to scan this repo."
77
required: false
8-
default: "elastic/docs-content"
8+
default: ""
99
docs-root:
1010
description: "Root directory to sweep"
1111
required: false
12-
default: "docs/"
12+
default: "."
1313
target-path:
1414
description: "Optional docs-root-relative directory to sweep recursively (accepts a leading slash)"
1515
required: false
@@ -29,7 +29,6 @@ on:
2929

3030
permissions:
3131
actions: read
32-
copilot-requests: write
3332
contents: read
3433
discussions: write
3534
issues: write
@@ -45,3 +44,5 @@ jobs:
4544
scope-mode: ${{ inputs.scope-mode }}
4645
target-batch-size: ${{ inputs.target-batch-size }}
4746
max-per-fix-issue: ${{ inputs.max-per-fix-issue }}
47+
secrets:
48+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}

agentic-workflows/docs-issue-scope/example.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ name: Docs Issue Scope
22
on:
33
issue_comment:
44
types: [created]
5+
workflow_dispatch:
56

67
permissions:
78
actions: read
8-
copilot-requests: write
99
contents: read
1010
discussions: write
1111
issues: write
1212
pull-requests: write
1313

1414
jobs:
1515
run:
16-
if: startsWith(github.event.comment.body, '/docs-issue-scope')
16+
if: >-
17+
github.event_name == 'workflow_dispatch' ||
18+
startsWith(github.event.comment.body, '/docs-issue-scope')
1719
uses: elastic/docs-actions/.github/workflows/gh-aw-docs-issue-scope.lock.yml@v1
20+
secrets:
21+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}

agentic-workflows/docs-openings-sweep/example.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
source-repo:
66
description: "Repository to scan (owner/repo). Leave empty to scan this repo."
77
required: false
8-
default: "elastic/docs-content"
8+
default: ""
99
docs-root:
1010
description: "Root directory to sweep"
1111
required: false
12-
default: "docs/"
12+
default: "."
1313
target-path:
1414
description: "Optional docs-root-relative directory to sweep recursively (accepts a leading slash)"
1515
required: false
@@ -29,7 +29,6 @@ on:
2929

3030
permissions:
3131
actions: read
32-
copilot-requests: write
3332
contents: read
3433
discussions: write
3534
issues: write
@@ -45,3 +44,5 @@ jobs:
4544
scope-mode: ${{ inputs.scope-mode }}
4645
target-batch-size: ${{ inputs.target-batch-size }}
4746
max-per-fix-issue: ${{ inputs.max-per-fix-issue }}
47+
secrets:
48+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
Lines changed: 46 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
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+
215
on:
316
workflow_dispatch:
417
inputs:
518
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'"
720
required: false
821
default: "all"
922
source-repo:
1023
description: "Repository to scan (owner/repo). Leave empty to scan this repo."
1124
required: false
12-
default: "elastic/docs-content"
25+
default: ""
1326
docs-root:
1427
description: "Root directory in the source repo (set to '.' for repos where docs live at the root)"
1528
required: false
@@ -22,111 +35,42 @@ on:
2235
description: "How to scope the matched markdown files: auto, full, or shard"
2336
required: false
2437
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"
4538

4639
permissions:
47-
actions: read
48-
copilot-requests: write
40+
actions: write # required to dispatch sibling workflows via `gh workflow run`
4941
contents: read
50-
discussions: write
51-
issues: write
52-
pull-requests: read
5342

5443
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"* ]]; }
9858
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+
}
11069
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
12273
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."

agentic-workflows/docs-staleness-sweep/example.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
source-repo:
66
description: "Repository to scan (owner/repo). Leave empty to scan this repo."
77
required: false
8-
default: "elastic/docs-content"
8+
default: ""
99
docs-root:
1010
description: "Root directory to sweep"
1111
required: false
12-
default: "docs/"
12+
default: "."
1313
target-path:
1414
description: "Optional docs-root-relative directory to sweep recursively (accepts a leading slash)"
1515
required: false
@@ -30,18 +30,9 @@ on:
3030
description: "Flag pages whose latest commit is older than this many months"
3131
required: false
3232
default: "24"
33-
stale-screenshot-min-gap-months:
34-
description: "Min gap between image and doc commit dates to flag a stale screenshot"
35-
required: false
36-
default: "6"
37-
lychee-config:
38-
description: "Path to a lychee config file in this repo (optional)"
39-
required: false
40-
default: ""
4133

4234
permissions:
4335
actions: read
44-
copilot-requests: write
4536
contents: read
4637
discussions: write
4738
issues: write
@@ -58,5 +49,5 @@ jobs:
5849
target-batch-size: ${{ inputs.target-batch-size }}
5950
max-per-fix-issue: ${{ inputs.max-per-fix-issue }}
6051
stale-content-months: ${{ inputs.stale-content-months }}
61-
stale-screenshot-min-gap-months: ${{ inputs.stale-screenshot-min-gap-months }}
62-
lychee-config: ${{ inputs.lychee-config }}
52+
secrets:
53+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)