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
58 changes: 38 additions & 20 deletions .github/workflows/gh-aw-docs-review.lock.yml

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

34 changes: 26 additions & 8 deletions .github/workflows/gh-aw-docs-review.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: |
Reviews pull request documentation changes under docs/ by using Copilot plus
Reviews pull request documentation changes in markdown files by using Copilot plus
Elastic Docs Skills. Reports a concise summary and line-level review comments
for actionable markdown issues.

Expand Down Expand Up @@ -29,6 +29,11 @@ on:
type: string
required: false
default: ""
review-scope:
description: "Markdown review scope: docs-subtree or repo-wide-markdown"
type: string
required: false
default: "docs-subtree"
setup-commands:
description: "Shell commands to run before the agent starts"
type: string
Expand Down Expand Up @@ -113,12 +118,20 @@ Do not guess alternate invocation formats.

This workflow is intended for pull request review flows triggered from a PR slash command such as `/docs-review` or from a consumer repository's PR checkbox menu.

This workflow supports two repository layouts through `inputs.review-scope`:

- `docs-subtree` — review changed markdown files only under `docs/`
- `repo-wide-markdown` — review changed markdown files anywhere in the repository

If `inputs.review-scope` is omitted, use `docs-subtree`.

When the workflow runs:

- Confirm that the triggering item is a pull request or a PR comment context. If this is not a PR context, call `noop` with a short explanation.
- Review only files that both changed in the PR and match `docs/**/*.md`.
- Ignore every other changed file, including markdown outside `docs/`.
- If no eligible files match `docs/**/*.md`, call `noop` with a short explanation.
- Validate `inputs.review-scope`. If it is not `docs-subtree` or `repo-wide-markdown`, call `noop` with a short explanation.
- Review only files that both changed in the PR and match the configured review scope.
- Ignore every other changed file outside the configured review scope.
- If no eligible files match the configured review scope, call `noop` with a short explanation.

## Step 1: Gather review context

Expand All @@ -138,16 +151,20 @@ Prefer conservative pagination when reading file lists, review comments, or diff

Build the review set from changed files that satisfy all of these rules:

- path starts with `docs/`,
- path ends with `.md`, and
- the file is part of the current pull request diff.

Then apply the configured scope filter:

- If `inputs.review-scope` is `docs-subtree`, keep only paths that start with `docs/`.
- If `inputs.review-scope` is `repo-wide-markdown`, keep all changed `.md` paths in the repository.

Skip:

- deleted files unless the deletion itself is the problem you are reporting,
- generated files,
- images, data files, YAML files, and non-markdown assets,
- markdown files outside `docs/`,
- markdown files outside the configured review scope,
- pre-existing issues in untouched files.

## Step 3: Review the changes
Expand Down Expand Up @@ -227,7 +244,7 @@ Do not report:

## Quality gate

If there are no eligible markdown files under `docs/`, call `noop`.
If there are no eligible markdown files in the configured review scope, call `noop`.

If you reviewed eligible files and found no actionable issues, submit a concise `COMMENT` review with a short summary and no inline comments.

Expand All @@ -245,7 +262,8 @@ Submit one final review body in this shape:
```markdown
## Docs review summary

- Reviewed `<N>` changed markdown file(s) under `docs/`.
- Reviewed `<N>` changed markdown file(s) in scope.
- Reviewed scope: `<docs-subtree | repo-wide-markdown>`.
- Ignored `<N>` non-eligible changed file(s) outside the review scope.
- Outcome: `<No actionable issues | Commented suggestions | Changes requested>`.

Expand Down
13 changes: 11 additions & 2 deletions agentic-workflows/docs-review/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Configure the `COPILOT_GITHUB_TOKEN` secret before running the workflow.
| Input | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `additional-instructions` | string | No | `""` | Repo-specific instructions appended to the review prompt |
| `review-scope` | string | No | `"docs-subtree"` | Markdown review scope: `docs-subtree` or `repo-wide-markdown` |
| `setup-commands` | string | No | `""` | Shell commands to run before the agent starts |
| `messages-footer` | string | No | _(default footer)_ | Footer appended to all review summaries |

Expand All @@ -42,9 +43,14 @@ The inline review comment cap for this workflow is set to `20`, so the workflow
The workflow reviews only files that both:

- changed in the current pull request, and
- match `docs/**/*.md`.
- match the configured markdown review scope.

It ignores markdown outside `docs/`, non-markdown files, and unrelated pre-existing issues in untouched files.
Supported review scopes:

- `docs-subtree` reviews only changed markdown files under `docs/`.
- `repo-wide-markdown` reviews changed markdown files anywhere in the repository.

It ignores markdown outside the configured review scope, non-markdown files, and unrelated pre-existing issues in untouched files.

If the pull request is linked to a parent issue, the review also checks whether the PR appears to satisfy that issue's documentation ask and reports the result in the summary review.

Expand Down Expand Up @@ -83,6 +89,7 @@ jobs:
startsWith(github.event.comment.body, '/docs-review')
uses: elastic/docs-actions/.github/workflows/gh-aw-docs-review.lock.yml@v1
with:
review-scope: docs-subtree
additional-instructions: |
This repository stores product documentation in `docs/`.
Prefer concise review comments with exact replacement text when possible.
Expand All @@ -93,3 +100,5 @@ jobs:
## PR checkbox menus

If your repository already uses a checkbox-driven AI menu, keep that workflow in the consumer repo and have the selected PR checkbox call `elastic/docs-actions/.github/workflows/gh-aw-docs-review.lock.yml@v1`. This keeps the reusable review logic in `docs-actions` while letting each repo decide how its PR menu is posted and refreshed.

For repositories like `docs-content` where markdown lives across the repository instead of under `docs/`, set `review-scope: repo-wide-markdown`.
2 changes: 2 additions & 0 deletions agentic-workflows/docs-review/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ jobs:
github.event.issue.pull_request != null &&
startsWith(github.event.comment.body, '/docs-review')
uses: elastic/docs-actions/.github/workflows/gh-aw-docs-review.lock.yml@v1
with:
review-scope: docs-subtree
secrets:
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
Loading