Skip to content

Replace PR docs hook with agentic workflow#14526

Closed
joperezr wants to merge 1 commit into
mainfrom
joperezr/agentic-docs-check
Closed

Replace PR docs hook with agentic workflow#14526
joperezr wants to merge 1 commit into
mainfrom
joperezr/agentic-docs-check

Conversation

@joperezr
Copy link
Copy Markdown
Member

@joperezr joperezr commented Feb 17, 2026

Summary

Replaces the broken pr-docs-hook.yml workflow with a new GitHub Agentic Workflow (pr-docs-check.md).

What was wrong

  • The old workflow relied on an expired PAT (DOCS_COPILOT_TOKEN) for Copilot CLI authentication
  • Results were only visible in the workflow run logs — unless someone clicked into the Actions tab, they would never see the docs recommendation
  • Cross-repo issue creation on microsoft/aspire.dev was also broken due to the expired token

What this PR does

  • New agentic workflow (pr-docs-check.md): Uses natural language instructions for an AI agent to analyze merged PRs for documentation needs
  • Triggers: On merged PRs against main and release/* branches
  • Safe outputs: Creates issues on microsoft/aspire.dev and comments on the PR — all through SafeOutputs (agent runs read-only)
  • GitHub App auth: Uses a GitHub App for cross-repo authentication instead of a PAT (no more token expiration)
  • Milestone assignment: Automatically assigns the correct milestone on microsoft/aspire.dev based on the target branch
  • Gitignore: Adds .github/aw/logs/ to prevent local agentic workflow debug logs from being committed

Before merging

This PR is kept as draft while we register the required GitHub App for cross-repo authentication to microsoft/aspire.dev. The app needs:

  • Repository permissions: Issues (Read & Write)
  • Installation on both dotnet/aspire and microsoft/aspire.dev
  • Secrets: DOCS_APP_ID (variable) and DOCS_APP_PRIVATE_KEY (secret) configured on dotnet/aspire
  • COPILOT_GITHUB_TOKEN secret for the Copilot CLI engine

Once the GitHub App is registered and secrets are configured, this PR can be marked ready for review.

Replace the broken pr-docs-hook.yml workflow (expired PAT) with a new
GitHub Agentic Workflow that:

- Triggers on merged PRs against main and release/* branches
- Uses an AI agent to analyze the PR diff for documentation needs
- Creates tracking issues on microsoft/aspire.dev with appropriate milestones
- Comments on the PR with results (docs needed or not)
- Uses a GitHub App for cross-repo authentication (no more expiring PATs)
- Enforces SafeOutputs for all write operations (security best practice)

Also adds .github/aw/logs/ to .gitignore to prevent local agentic
workflow debug logs from being committed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 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/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14526

Or

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

@github-actions
Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 8fec8c4:

Test Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateStartWaitAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
ResourcesCommandShowsRunningResources ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording

📹 Recordings uploaded automatically from CI run #22114492275

add-comment:
hide-older-comments: true

timeout-minutes: 15
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No way... let this cook, it's a lot of work to do - I think we should timeout after something like 90 minutes.

Suggested change
timeout-minutes: 15
timeout-minutes: 90

Use the GitHub tools to read the full pull request details for the PR number above,
including the title, description, author, base branch, and the full diff of changes.
Pay special attention to the **base branch** (e.g., `main` or `release/X.Y`) and the
**PR author** username, as both are needed in later steps.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
**PR author** username, as both are needed in later steps.
**PR author** username, as both are needed in later steps. Also, make note of any issues that this PR addresses as that might be additional context for potentially answering any questions.

IEvangelist added a commit to IEvangelist/aspire that referenced this pull request Apr 7, 2026
Replace the broken pr-docs-hook.yml workflow (expired PAT, Copilot CLI)
with a new GitHub Agentic Workflow (pr-docs-check.md) that:

- Triggers on merged PRs against main and release/* branches
- Analyzes the PR diff for documentation needs using an AI agent
- Checks out microsoft/aspire.dev and follows the doc-writer SKILL
- Creates a draft PR on microsoft/aspire.dev with actual docs changes
- Comments on the original aspire PR with a link to the draft PR
- Uses GitHub App auth (ASPIRE_BOT_APP_ID/ASPIRE_BOT_PRIVATE_KEY)
  for cross-repo operations instead of expiring PATs

Also recompiles daily-repo-status.lock.yml with gh aw v0.67.1.

Replaces microsoft#14526

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
IEvangelist added a commit that referenced this pull request Apr 7, 2026
* Replace pr-docs-hook with gh aw agentic workflow

Replace the broken pr-docs-hook.yml workflow (expired PAT, Copilot CLI)
with a new GitHub Agentic Workflow (pr-docs-check.md) that:

- Triggers on merged PRs against main and release/* branches
- Analyzes the PR diff for documentation needs using an AI agent
- Checks out microsoft/aspire.dev and follows the doc-writer SKILL
- Creates a draft PR on microsoft/aspire.dev with actual docs changes
- Comments on the original aspire PR with a link to the draft PR
- Uses GitHub App auth (ASPIRE_BOT_APP_ID/ASPIRE_BOT_PRIVATE_KEY)
  for cross-repo operations instead of expiring PATs

Also recompiles daily-repo-status.lock.yml with gh aw v0.67.1.

Replaces #14526

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix checkout and tools token scoping for cross-repo access

- Add owner/repositories to checkout github-app so the token is
  scoped to aspire.dev (not the current repo)
- Add 'aspire' to tools.github repositories so the agent can read
  PR details/diff from the source repo

Addresses Copilot review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist
Copy link
Copy Markdown
Member

@joperezr - I'm closing this as we merged #15916.

@IEvangelist IEvangelist closed this Apr 7, 2026
radical pushed a commit that referenced this pull request Apr 7, 2026
* Replace pr-docs-hook with gh aw agentic workflow

Replace the broken pr-docs-hook.yml workflow (expired PAT, Copilot CLI)
with a new GitHub Agentic Workflow (pr-docs-check.md) that:

- Triggers on merged PRs against main and release/* branches
- Analyzes the PR diff for documentation needs using an AI agent
- Checks out microsoft/aspire.dev and follows the doc-writer SKILL
- Creates a draft PR on microsoft/aspire.dev with actual docs changes
- Comments on the original aspire PR with a link to the draft PR
- Uses GitHub App auth (ASPIRE_BOT_APP_ID/ASPIRE_BOT_PRIVATE_KEY)
  for cross-repo operations instead of expiring PATs

Also recompiles daily-repo-status.lock.yml with gh aw v0.67.1.

Replaces #14526

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix checkout and tools token scoping for cross-repo access

- Add owner/repositories to checkout github-app so the token is
  scoped to aspire.dev (not the current repo)
- Add 'aspire' to tools.github repositories so the agent can read
  PR details/diff from the source repo

Addresses Copilot review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants