Skip to content
Merged
Show file tree
Hide file tree
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: 17 additions & 16 deletions .github/workflows/doc-maintainer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions .github/workflows/doc-maintainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sandbox:
engine:
id: claude
model: claude-haiku-4-5
max-turns: 15
tools:
edit:
bash: true
Expand Down Expand Up @@ -57,7 +58,7 @@ steps:
run: |
CONTEXT_DIR=/tmp/gh-aw/doc-maintainer-context
if [ "$EXPR_STEPS_HAS_CHANGES_OUTPUTS_HAS_CHANGES" = "true" ]; then
git log --since="7 days ago" --format="=== Commit %H: %s ===" --patch --stat --unified=3 -- src/ containers/ scripts/ docs/ '*.md' | head -500 > "$CONTEXT_DIR/recent-diffs.txt"
git log --since="7 days ago" --format="=== Commit %H: %s ===" --patch --stat --unified=2 -- src/ containers/ scripts/ docs/ '*.md' | head -200 > "$CONTEXT_DIR/recent-diffs.txt"
else
echo "No relevant source changes detected in the past 7 days." > "$CONTEXT_DIR/recent-diffs.txt"
fi
Expand Down Expand Up @@ -97,20 +98,20 @@ steps:
git log --since="7 days ago" --format="%H" -- src/ containers/ scripts/ | \
while read -r sha; do
git show --name-only --format="" "$sha" -- docs/ '*.md' 2>/dev/null
done | grep -E '(^docs/.*\.md$|^[^/]+\.md$)' | sort -u | head -30 > "$AFFECTED" || true
done | grep -E '(^docs/.*\.md$|^[^/]+\.md$)' | sort -u | head -10 > "$AFFECTED" || true
fi

if [ ! -s "$AFFECTED" ] && [ "$EXPR_STEPS_HAS_CHANGES_OUTPUTS_HAS_CHANGES" = "true" ]; then
git log --since="7 days ago" --name-only --format="" -- src/ containers/ scripts/ | \
grep -v '^$' | sed -E 's|.*/||; s|\.[^.]+$||' | \
tr '[:upper:]' '[:lower:]' | tr '[:punct:]' '\n' | grep -E '^[a-z0-9]{3,}$' | sort -u > "$TOKENS" || true
if [ -s "$TOKENS" ]; then
grep -i -F -f "$TOKENS" "$DOC_POOL" | head -30 > "$AFFECTED" || true
grep -i -F -f "$TOKENS" "$DOC_POOL" | head -10 > "$AFFECTED" || true
fi
fi

if [ ! -s "$AFFECTED" ]; then
head -30 "$DOC_POOL" > "$AFFECTED"
head -10 "$DOC_POOL" > "$AFFECTED"
fi

cp "$AFFECTED" "$CONTEXT_DIR/affected-docs.txt"
Expand Down Expand Up @@ -141,21 +142,26 @@ This repository is a security-critical firewall for GitHub Copilot CLI. Accurate

## Task Steps

### 1. Analyze Pre-computed Changes
### 0. Check For Changes First (Do This Before Anything Else)

Read `/tmp/gh-aw/doc-maintainer-context/has-changes.txt`.

Read `/tmp/gh-aw/doc-maintainer-context/has-changes.txt` and `/tmp/gh-aw/doc-maintainer-context/changed-count.txt` first.
- If `false`: call `safeoutputs noop` immediately and stop. Do not read any other files.
- If `true`: proceed to Step 1.

### 1. Analyze Pre-computed Changes

If `has-changes.txt` is `false`, exit immediately using a no-op result without editing files or creating a PR.
Read `/tmp/gh-aw/doc-maintainer-context/changed-count.txt`.

Use `/tmp/gh-aw/doc-maintainer-context/recent-diffs.txt` as your source of truth for recent source changes. Do not run `git show <sha>` per commit unless absolutely necessary.
Use `/tmp/gh-aw/doc-maintainer-context/recent-diffs.txt` as your **sole source** for recent source changes. **Do not run any `git` commands** — all required git data is already pre-computed. Running `git show`, `git log`, or `git diff` wastes turns.

### 2. Identify Documentation Gaps

Compare code changes with current documentation and identify what needs to be updated.
Review only the files listed in `/tmp/gh-aw/doc-maintainer-context/affected-docs.txt` (max 10 files) and identify what needs to be updated. Do not proactively read additional files not in this list.

### 3. Review Current Documentation

Start with `/tmp/gh-aw/doc-maintainer-context/affected-docs.txt`. Review the broader list in `/tmp/gh-aw/doc-maintainer-context/doc-files.txt` only when there is a clear link to the recent source changes.
Review only `/tmp/gh-aw/doc-maintainer-context/affected-docs.txt`. Do not expand review scope to `/tmp/gh-aw/doc-maintainer-context/doc-files.txt`.

### 4. Verify Code Examples

Expand Down
Loading
Loading