Skip to content

Add PR documentation check as agentic workflow#34572

Open
jfversluis wants to merge 2 commits intomainfrom
feature/pr-docs-hook
Open

Add PR documentation check as agentic workflow#34572
jfversluis wants to merge 2 commits intomainfrom
feature/pr-docs-hook

Conversation

@jfversluis
Copy link
Copy Markdown
Member

@jfversluis jfversluis commented Mar 19, 2026

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description

Adds a GitHub Agentic Workflow that automatically analyzes merged PRs to determine if documentation updates are needed on dotnet/docs-maui. Inspired by dotnet/aspire PR #14526.

How it works

A single .md file (.github/workflows/pr-docs-check.md) contains natural language instructions for an AI agent that:

  1. Gathers PR info — reads the diff, title, author, base branch
  2. Filters — skips bot PRs, backports, test/infra/docs-only changes; always proceeds for PublicAPI.Unshipped.txt or template changes
  3. Analyzes — reviews the diff for new APIs, features, breaking changes, config options, platform-specific behaviors
  4. Checks existing docs — browses dotnet/docs-maui to find relevant pages
  5. Takes action — creates a tracking issue on dotnet/docs-maui and comments on the PR

Why agentic workflow instead of traditional Actions?

  • No CLI setup — no Node.js install or Copilot CLI binary needed
  • GitHub App auth — cross-repo issue creation via GitHub App (no PAT expiration)
  • Safe outputs — controlled write channels for issues and comments
  • Maintainable — filtering and analysis logic in natural language, easy to update

Files changed

  • ✅ Added: .github/workflows/pr-docs-check.md — the agentic workflow
  • ✅ Updated: .gitignore — ignore .github/aw/logs/
  • ❌ Removed: .github/workflows/pr-docs-hook.yml — replaced by agentic workflow
  • ❌ Removed: .github/prompts/docs-audit-prompt.md — prompt now inline in workflow

Triggers

  • Merged PRs to main, net*.0, and release/* branches
  • Manual trigger via workflow_dispatch with a PR number

Prerequisites

  • GitHub App with Issues (Read & Write) installed on dotnet/maui and dotnet/docs-maui
  • Secrets: DOCS_APP_ID (variable) and DOCS_APP_PRIVATE_KEY (secret)
  • Label docs-from-code on dotnet/docs-maui

Adds a GitHub Actions workflow that analyzes merged PRs using Copilot CLI
to determine if documentation updates are needed on dotnet/docs-maui.

The workflow has two jobs:
- A cheap filter job that skips bot PRs, backports, test/infra-only changes,
  and fast-tracks PublicAPI.Unshipped.txt changes
- An expensive analysis job that uses Copilot CLI to generate specific
  documentation recommendations and creates tracking issues on docs-maui

Inspired by dotnet/aspire's pr-docs-hook workflow, adapted for MAUI's
repo structure, PR volume, and docs-maui integration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 19, 2026 15:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34572

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34572"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an automated post-merge GitHub Actions workflow that decides whether a merged PR likely needs documentation updates in dotnet/docs-maui, and (when needed) files a tracking issue plus comments back on the PR.

Changes:

  • Introduces a two-job workflow (filter + gated analyze) to limit Copilot analysis to likely doc-impacting PRs.
  • Runs Copilot CLI against the PR diff using a MAUI-specific prompt and posts results back to the PR.
  • Creates a cross-repo issue in dotnet/docs-maui when documentation updates are recommended.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/pr-docs-hook.yml New workflow that filters merged PRs, runs Copilot diff analysis, optionally opens docs-maui issues, and comments results on the PR.
.github/prompts/docs-audit-prompt.md Prompt text used by the workflow to guide documentation-impact analysis and issue formatting.

You can also share your feedback on Copilot code review. Take the survey.

Replaces the traditional GitHub Actions workflow (pr-docs-hook.yml) with a
GitHub Agentic Workflow (pr-docs-check.md) for analyzing merged PRs for
documentation needs on dotnet/docs-maui.

Changes:
- New: .github/workflows/pr-docs-check.md (agentic workflow)
- Removed: .github/workflows/pr-docs-hook.yml (old shell-based workflow)
- Removed: .github/prompts/docs-audit-prompt.md (prompt now inline in .md)
- Updated: .gitignore (add .github/aw/logs/)

The agentic workflow:
- Uses natural language instructions instead of bash scripts
- Authenticates cross-repo via GitHub App (no PAT expiration)
- Uses safe-outputs for controlled issue creation and PR commenting
- Includes smart filtering: skips bot PRs, backports, test/infra-only changes
- Always analyzes PublicAPI.Unshipped.txt and template changes
- Triggers on merges to main, net*.0, and release/* branches

Prerequisites:
- GitHub App with Issues (Read & Write) on dotnet/docs-maui
- Secrets: DOCS_APP_ID (variable) and DOCS_APP_PRIVATE_KEY (secret)
- Label 'docs-from-code' on dotnet/docs-maui

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jfversluis jfversluis changed the title Add PR documentation check workflow Add PR documentation check as agentic workflow Mar 19, 2026
@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Mar 23, 2026
@dotnet dotnet deleted a comment from MauiBot Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants