GitHub エージェント型ワークフローによるリポジトリ間ドキュメントの自動化
GitHub は Agentic Workflows を活用し、コード変更とドキュメント作成を異なるリポジトリ間でも安全かつ自動化可能にし、開発チームの生産性を劇的に向上させる実証例を発表した。
キーポイント
クロスリポジトリ自動化の課題解決
コードとドキュメントが別々のリポジトリにある場合、従来の手動プロセスでは遅延や情報の欠落が生じていたが、この新手法でそれを解消した。
セキュリティを担保するエージェント設計
広範な権限を持つトークンを発行せず、エージェントが意図(JSON)のみを出力し、別途厳格なワークフローで実行することでセキュリティリスクを排除している。
実証された数値的成果
Microsoft Aspire チームの実装により、82 件の機能ドキュメント PR が平均 44.8 時間でレビュー済みでマージされ、人員増なしで効率化が達成された。
Markdown ベースのワークフロー定義
YAML の代わりに Markdown ファイルにフロントマターと自然言語のプロンプトを記述し、コンパイル時に標準的な GitHub Actions ワークフローに変換する新しい形式を採用している。
安全な出力処理と権限分離
エージェントは直接 GitHub に書き込まず、意図(JSON)を生成し、厳格な許可リストを持つ別プロセスがこれをマテリアライズすることでセキュリティを確保しています。
ドキュメント対象ブランチの自動判定ロジック
PR のマイルストーンタイトルやリンクされたイシューからリリースブランチを解析し、エージェントが実行される前にターゲットブランチを決定することで誤った場所への書き込みを防いでいます。
ドキュメントレビューの自動化と責任の明確化
生成されたドキュメント PR は、元の機能 PR を承認した専門知識を持つ(SME)レビュアーに自動的に割り当てられ、品質担保を自動化しています。
影響分析・編集コメントを表示
影響分析
この記事は、AI エージェントを単なる実験的なツールから、セキュリティ要件を満たす本番環境のインフラへと昇華させる重要な転換点を示しています。特に、コードとドキュメントが分離している大規模プロジェクトにおいて、人的ミスを防ぎつつ自動化を実現する具体的なアーキテクチャを提供しており、開発プラクティスの標準化に大きな影響を与える可能性があります。
編集コメント
「AI を安全に実装する」ことの難しさを、具体的な数値とアーキテクチャ設計で解きほぐした素晴らしい事例です。特に「エージェントが直接書き込まず意図のみを出力する」というセキュリティ担保の仕組みは、業界全体にとって重要な教訓となります。
「ドキュメントはどこにあるの?」製品チームの誰一人として、この質問に答えたいと思っている人はいません。正直な返答は通常、「裏側です」という何らかの変形になります。ライターはクローズされたプルリクエストを前に立ち尽くし、何が変更されたのか逆算しようとしています。そのプルリクエストの著者はすでに次の仕事へ移っています。ドキュメントが実際に公開される頃には、その機能は既にリリース済みで、場合によっては複数回にわたってリリースされています。
かつてのアスパイアチーム(分散型アプリケーション向けの開発ツールを構築する 10 人規模の小チーム)もそうでした。数ヶ月前、私たちはすでに信頼している自動化プロセスに AI を安全に取り込む方法を模索していました。その時、GitHub Agentic Workflows を発見しました。私はすぐにプロトタイプを microsoft/aspire に組み込み始めました。
これが GitHub から直接引き出した数字で示す成果です:Aspire 13.3 と 13.4 において、82 の機能ドキュメント用プルリクエストがマージされました。これらはすべて、製品側のプルリクエストから平均 44.8 時間後にマージされ、それぞれの機能を実装したエンジニアによってレビューされています。新規採用は不要でした。プロセスの再教育も不要でした。ただ、「誰がこのドキュメントを書くのか?」という問い方を別の形に変えただけです。
🔒 制約:レポジトリ間自動化が難しい部分
私たちのプロダクトは microsoft/aspire にあり、ドキュメントサイトは microsoft/aspire.dev にあります。異なるリポジトリ、デプロイ先、そしてレビューチェーンです。ほとんどのチームは同じリポジトリ内での自動化をすぐに理解しますが、クロスリポジトリ間の自動化こそが難所となります。広範なリポジトリスコープのトークンは博物館に飾っておくべきものであり、責任あるセキュリティ姿勢( ours を含む)はそれ accordingly に制限します。それは良いことです。しかし、ドキュメントを書く場所とコードを書く場所が異なる場合、これは実質的なボトルネックになります。
長年のデフォルトのワークフローは以下の通りでした:
エンジニアが microsoft/aspire で機能を実装する。
数週間後にドキュメンテーション担当者がそれに気づく。
ドキュメンテーション担当者がプルリクエストを開き、差分を読み込んで、変更内容を明確にするためにエンジニアに連絡する。
エンジニアは次の機能に取り掛かっており、漠然としか覚えておらず、半分だけの情報を返信する。
ドキュメントのドラフト版がリリース済みである場合さえある状態で出荷される。
これは逆算的なコストです。エージェントに「どこでも書き込み可能なトークン」を渡すことなく、リポジトリ間を横断する自動化が必要でした。GitHub Agentic Workflows がその答えとなりました。
烙 GitHub Agentic Workflows とは何か
GitHub Agentic Workflows は、GitHub Next チームによるプロジェクトで、私はこれを人々に「モデルがワークアイテムのプロセッサとして機能し、セキュリティレビューを満たすガードレールを持つ GitHub Actions」と説明しています。これは単純化しすぎかもしれませんが、核心を突いています。
その構造は以下の通りです:
ワークフローは単一の Markdown ファイル(.github/workflows/my-thing.md)として作成します。上部には YAML スタイルのフロントマター、下部には英語のプロンプトを記述します。
GitHub Agentic Workflows を実行してコンパイルすると、並列の .lock.yml ファイル(通常の GitHub Actions ワークフロー)が生成され、これと一緒にコミットされます。
ランタイムでは、ワークフローは制約されたツールセットを使用してプロンプトに対してエージェントを実行します。
重要なのは、エージェントが直接 GitHub に書き込まないことです。エージェントは意図(作成したいプルリクエスト、イシュー、コメントを記述した JSON ブロック)を出力し、別の狭いスコープのジョブ(安全な出力ハンドラー)が、ワークフローごとの GitHub アプリに対してその意図を実行します。
最後の項目が鍵となります。エージェントは読み取りアクセス権とプロンプトを取得します。書き込み操作は、明示的な許可リストを持つ小さな検証可能なパイプラインを経由します。セキュリティレビューの承認を得て、私たちはリリースします。
💚 余談:親和性のあるスタック
構築に使用しているツール自体が、同じツールで構築されているとき、私はそれを愛しています。GitHub Agentic Workflows のドキュメントは Astro と Starlight で構築されています。aspire.dev も同様で、Astro に Starlight を用い、より広範な Starlight プラグインエコシステム(astro-mermaid, starlight-llms-txt, starlight-sidebar-topics, starlight-image-zoom、美しい @catppuccin/starlight テーマなど)で装飾されています。Chris Swithinbank 氏と Starlight のメンテナーの方々への感謝を込めて、このエコシステム全体は、心から情熱を持っている人々によって設計されたものであると感じさせられます。
そこには真の親和性があります。ドキュメントを自動化するために使用するツールと、そのドキュメントサイトが構築される基盤は同じものです。便利なのは、次のセクションで登場する Mermaid シーケンス図(Mermaid sequence diagram)が、両方の世界で全く同じようにレンダリングされる点です。
エンドツーエンドのパイプライン
ここに私たちが着地点としたフローがあります。主人公は、microsoft/aspire リポジトリに存在する pr-docs-check.md というワークフローです。

実行は、main ブランチまたは release/* に対してクローズされたプルリクエストでトリガーされ、merged == true という条件によってゲートされます。そこから、エージェントが起動する前にまず、プレーンな Bash で決定論的なターゲットブランチ解決スクリプトが実行されます。
- プルリクエストのマイルストーンタイトル(例:13.4 → release/13.4 on aspire.dev)
- リンクされた課題のマイルストーンタイトル(本文から Fixes/Closes/Resolves #N を解析し、各課題を取得して、最初の空でないマイルストーンを抽出)
- プルリクエストのベース参照が release/X.Y[.Z] に一致する場合
- それ以外の場合は main ブランチにフォールバック
これが要となる部分です。プロダクトリポジトリのマイルストーンは、ドキュメントリポジトリのリリースブランチと明確に対応しています。エージェントが実際に実行される際、ターゲットブランチについて創作したり推測したりすることなく、ドキュメントが配置されるべき場所を正確に把握します。
エージェントは差分を読み込み、リンクされた課題を検索し、ドキュメントが必要かどうかを判断します。必要であれば、既存の doc-writer スキル(トーン、MDX 規約、Starlight コンポーネント)に従って、チェックアウトされた microsoft/aspire.dev ワークスペース内で実際のコンテンツを作成します。その後、create_pull_request の安全出力(safe-output)を発行して処理を委譲します。
安全出力ハンドラーが引き継ぎます:
- タイトルプレフィックス: [docs]
- ラベル: docs-from-code
- draft: true(自動マージは決して行いません)
- ベースブランチ: エージェントが指定、main または release/* に制限
- 対象リポジトリ: microsoft/aspire.dev
レビュアー:ソースプルリクエストのレビューから特定された SME(専門知識を持つ者)—つまり、製品チームがその機能の承認を信頼していた人物が、今度はその機能に関するドキュメントの承認を求められることになります。
コンパニオンジョブは、ドキュメント用プルリクエストへのリンクを含むマーカーコメントをソースプルリクエストに投稿し、再実行時に古い pr-docs-check コメントを最小化します。直近で Merge を行ったエンジニアには数分以内に通知が届きます:「ドキュメントのドラフトです。確認をお願いします?」
安全な出力契約(safe-outputs contract)
セキュリティに関する全体の話は、小さな、つまらないフロントマターの部分に集約されます:
tools:
github:
toolsets: [repos, issues, pull_requests]
min-integrity: approved # ピン留めされ、整合性が確認されたアクションのみを実行
allowed-repos:
- microsoft/*
github-app:
app-id: ${{ secrets.ASPIRE_BOT_APP_ID }}
private-key: ${{ secrets.ASPIRE_BOT_PRIVATE_KEY }}
owner: "microsoft"
repositories: ["aspire.dev", "aspire"]
safe-outputs:
create-pull-request:
title-prefix: "[docs] "
labels: [docs-from-code]
draft: true # 人間が関与するループ、常に
base-branch: main
allowed-base-branches: [main, release/*]
target-repo: "microsoft/aspire.dev"
protected-files: blocked # AGENTS.md、マニフェスト、セキュリティ設定:手をつけない
fallback-as-issue: true
これは平文での取り決めです。エージェントは、GitHub App トークンを取得しますが、そのインストールスコープは製品リポジトリとドキュメントリポジトリの 2 つに厳密に限定されており、組織内の他のどこにもアクセスできません。プルリクエストを作成できるのは main ブランチまたは release/* ブランチに対してのみです。AGENTS.md ファイルや依存関係マニフェストはポリシーにより禁止されています。もしプルリクエスト作成が失敗した場合(ネットワークの一時的な不具合、競合、その他あらゆる要因)、フレームワークは自動的にイシューの作成にフォールバックするため、何かが黙って失われることはありません。
これがセキュリティレビューで実際に評価された部分です。エージェントの推論プロセスには曖昧さがありますが、アクションの範囲は明確です。
数値による分析
以下は、Aspire 13.3 リリースの後半から 13.4 への移行期間にかけての、直近 30 日間(2026 年 5 月 3 日〜6 月 2 日)の統計データです:
メトリック値
microsoft/aspire でマージされた製品プルリクエスト数 396 (main: 338 / release/13.3: 50 / release/13.2: 8)
pr-docs-check ワークフローの実行回数 396
microsoft/aspire.dev に作成されたドラフトドキュメント用プルリクエスト数 82
- マージ済み 82 (100%)
- マージなしでクローズ 0
- 未だにオープン中 0
ドキュメント用プルリクエストのターゲットブランチ 52 → release/13.3, 27 → release/13.4, 3 → main
ドキュメントの平均マージまでの時間(メディアン)44.8 時間
24 時間以内 / 7 日以内にマージされた割合 38% / 96%
注:数値は執筆時点でのものです。ワークフローは継続して実行されているため、総数は今後さらに増加します。
これらの数値のうち、いくつかは再考に値するものがあります:
396 回の実行→82 のプルリクエストは欠陥ではありません。このワークフローはマージされたすべてのプルリクエストで実行されますが、その大半は内部のリファクタリング、テストの修正、依存関係の更新であり、ユーザーに直接影響を与える変更はありません。エージェントが「ドキュメント不要」と 300 回以上発言したのは機能です。
100% のマージ率は、エージェントによるドキュメント選定が正しいことを示しています。v1 の偽陽性フェーズ後に導入したより厳密なプロンプトが効果を発揮しています。
✅ 成功した点、❌ 失敗した点
成功した点
✅ マイルストーンとリリースブランチのマッピング。これが私たちが行った中で最もレバレッジの高い選択でした。エンジニアはすでにプルリクエストやイシューにマイルストーンを設定しており、これによりターゲットブランチへの正確なルーティングを無料で実現できました。
✅ ドラフトのみ、専門家がレビュー担当。エージェントがマージを行うことはありません。機能を実装したエンジニア自身がドキュメントの正確性を確認します。これで、ドキュメント層で機能を逆推定する作業は不要になりました。エンジニアは、自分がすでにいる場所で、既存のドキュメントドラフトに対して何を記述すべきかを指示するだけです。
✅ ワークフローごとのスコープ限定 GitHub アプリ。各ワークフローには、明示的なリポジトリと権限スコープを持つ独自のアプルトークンが付与されます。セキュリティレビューも承認済みです。私たちも承認しましたが、キーのローテーションが必要になったのは初めてでした。
✅ 保護ファイル:ブロック。エージェントは AGENTS.md、パッケージマニフェスト、またはリポジトリのセキュリティ設定に一切アクセスできません。これがルールです。
失敗した点(当初)
❌ エージェントの「これはドキュメントに値するか?」というゲートは、最初のバージョンでは寛容すぎました。CI の調整やログのリファクタリングなど、実際に内部のみの変更に対してプルリクエストをドラフト作成してしまいました。その結果、69 件のプルリクエストのうち 9 件(約 13%)がクローズされたため、プロンプトのユーザー向け変更定義を厳格化し、明確なネガティブ例(CI、内部ヘルパー、テストのみ対象など)を追加しました。現在では、その率は低下傾向にあります。
❌ リポジトリ間でのプルリクエスト作成には、ドキュメントからは明らかな「ミラーされたチェックアウトパターン」が必要でした。エージェントは 1 つのリポジトリ内で動作しますが、safe-outputs はブランチをプッシュするために対象リポジトリを見つける必要があります。これを解決するため、microsoft/aspire.dev を 2 回チェックアウトしました。1 回は現在のワークスペースとして、もう 1 回は _repos/aspire.dev の下に配置し、safe-outputs ハンドラーがそれを決定論的に再発見できるようにしました。
❌ 大きな差分はプロンプトの予算を圧迫します。GitHub Agentic Workflow では、エージェント実行前の bash スクリプトでプルリクエストのメタデータ(関連するイシュー、マイルストーン、ベースブランチ)を事前に抽出し、エージェントには巨大なペイロードではなく、小さく構造化されたサマリーを提供するようにしています。これは GitHub Agentic Workflow に設計段階から組み込まれたパターンであり、機能しています。
Wrapping up
私たちが行った変更は考え方をシフトさせました。ドキュメントが完成するまで、その機能は完了したとは見なされません。ドキュメントはもはや、紐に繋がった缶のように機能の後に遅れてついてくるものではありません。エンジニアによるレビューがゲートとなり、ボットがタイピングを担当します。
重要なのは、これはドキュメント作成者を置き換えるものではなく、彼らの負担を軽減するものだということです。以前はドキュメント作成者の時間は機能の逆エンジニアリングに費やされていましたが、今では人間しかうまくできないことに時間を割いています:物語性のあるページ、サンプルプログラム、概念的なウォークスルーなど、diff から自動的に生成されないドキュメントの部分です。ボットは、誰にとっても決して楽しいものではない機械的な作業(「新しいオプションが追加されました;参照ページの更新はこちら」)を処理します。
GitHub Agentic Workflows(および安全な出力プリミティブを設計の第一級要素として組み込んだこと)に対して GitHub Next チームに心から感謝し、自動化するドキュメントプラットフォームを提供してくれた Chris Swithinbank と Starlight のメンテナーにも感謝します。また、セキュリティチームの方々に心からの感謝を申し上げます。彼らのガードレールが、私たちに最初から正しい設計を迫ってくれました。優れた自動化の退屈な秘密は、強力なセキュリティ制約がシステムをより信頼性が高く、より正確にするという点にあります。
製品をあるリポジトリで構築し、ドキュメントを別のリポジトリで公開する場合—特に非自明なセキュリティ境界内で行う必要がある場合—GitHub Agentic Workflows は真剣に検討する価値があります。pr-docs-check などの一つのワークフローから始め、あなたのドキュメントまでの平均時間がどう変化するのかを観察してください。
他のワークフロー
pr-docs-check は私がこの投稿で取り上げたものですが、単独で動作しているわけではありません。残りの部分に興味があれば、ソースコードは公開されています:
milestone-changelog.md: 2 時間ごとに実行され、アクティブなマイルストーンに新しくマージされたプルリクエストを取得し、新機能、改善点、注目すべきバグ修正を記載した 13.x-Change-log ウィキページと、それに対応する編集フィードバック用イシューを維持します。実行回数は 346 回です。
release-update-support-mdx.md: 安定版の Aspire リリースにおいて、aspire.dev 上に [support] プルリクエストを作成し、サポートポリシーページを更新します(新バージョンを昇格させ、前バージョンを降格させ、「最終更新日」バッジを最新化します)。
update-integration-data.md: docs リポジトリ内に存在し、pnpm update:all を毎日実行して NuGet メタデータ、GitHub 統計情報、サンプルデータを更新し、期限切れの実行に対して置換・クローズロジックを持つ chore: Update integration data プルリクエストをオープンします。実行回数は 27 回で、マージされたプルリクエストは 8 つです。
repo-pulse.md: 単一のイシューにピン留めされ、その場で更新されるローリング 3 日間のリポジトリダッシュボードです。最近のマージ、レビュー待ちのプルリクエスト、新しいイシュー、ディスカッション活動を表示します。イシューは 1 つだけですが、常に最新の状態を維持しています。
自動化を楽しみましょう、皆さん! 烙
本記事「GitHub エージェントワークフローによるクロスリポジトリドキュメントの自動化」は、最初に The GitHub Blog で公開されました。
原文を表示
“Where are the docs?” It’s a question nobody on a product team enjoys answering. The honest reply is usually some variant of “behind.” A writer is staring at a closed pull request, trying to reverse-engineer what changed. The pull request’s author has already moved on. By the time the doc actually publishes, the feature has shipped, sometimes more than once.
That used to be us on the Aspire team (we’re a small team of 10 building dev tools for distributed apps). A few months back, we were trying to figure out how to safely bring AI into automations we already trusted. That’s when we discovered GitHub Agentic Workflows. I started bolting prototypes into microsoft/aspire.
Here’s what that bought us, in numbers pulled straight out of GitHub: for Aspire 13.3 and 13.4, 82 feature-docs pull requests merged at a median of 44.8 hours after the product pull request, every one of them reviewed by the engineer who shipped the feature. No new headcount. No process retraining. Just a different way of asking “who writes this?”
The constraint: cross-repo automation is the hard part
Our product lives in microsoft/aspire and our docs site lives in microsoft/aspire.dev—different repo, deploy target, and review chain. Most teams figure out same-repo automation pretty quickly; cross-repo automation is where things get sharp. Broad repo-scoped tokens belong in a museum, and any responsible security posture (ours included) restricts them accordingly. That’s a good thing. It’s also a real bottleneck if the place where you write the docs isn’t the place where you write the code.
The default workflow for years was:
Engineer ships a feature in microsoft/aspire.
Docs writer notices weeks later.
Docs writer opens the pull request, reads the diff, and pings the engineer to clarify what changed.
Engineer is on the next feature, vaguely remembers, replies with half the picture.
Docs draft ships, sometimes against a release that’s already out.
This is the reverse-engineering tax. We needed automation that crossed repos without handing an agent a write-everywhere token. GitHub Agentic Workflows turned out to be the answer.
烙 Why GitHub Agentic Workflows
GitHub Agentic Workflows is a project from the GitHub Next team that I keep describing to people as “GitHub Actions, but with a model as the work-item processor and guard rails that satisfy security review.” That’s reductive, but it’s close.
The shape of it:
You author a workflow as a single markdown file (.github/workflows/my-thing.md). YAML-style frontmatter on top, an English-language prompt underneath.
You run GitHub Agentic Workflows compile, and it generates a sibling .lock.yml (a normal GitHub Actions workflow) that you commit alongside.
At runtime, the workflow runs an agent against your prompt with a constrained toolset.
Critically, the agent doesn’t write to GitHub directly. It emits intent (a JSON blob describing the pull requests, issues, and comments it wants to create), and a separate, narrowly scoped job (the safe-outputs handler) materializes that intent against a per-workflow GitHub app.
That last bullet is the unlock. The agent gets read access and a prompt. Writes go through a tiny verifiable pipeline with explicit allow-lists. Security review nods. We ship.
A small aside: kindred stacks
I love when the tools you’re using to build are built with the same tools you’re using to build with. The GitHub Agentic Workflows docs are built with Astro and Starlight. So is aspire.dev—Astro with Starlight, dressed up with the wider Starlight plugin ecosystem (astro-mermaid, starlight-llms-txt, starlight-sidebar-topics, starlight-image-zoom, the gorgeous @catppuccin/starlight theme, and more. Shout-out to Chris Swithinbank and the Starlight maintainers, the entire ecosystem feels designed by people who genuinely care).
There’s a real kinship there. The tool we use to automate docs and the docs site we automate into share the same foundation. Convenient, because the Mermaid sequence diagram in the next section renders the exact same way in both worlds.
The end-to-end pipeline
Here’s the flow we landed on. The protagonist is a workflow called pr-docs-check.md living in microsoft/aspire.

A run starts on pull_request: closed against main or release/*, gated by merged == true. From there, the workflow first runs a deterministic target branch resolver in plain bash before the agent ever wakes up:
Pull request milestone title (e.g. 13.4 → release/13.4 on aspire.dev).
Linked-issue milestone title (parse Fixes/Closes/Resolves #N from the body, fetch each issue, take the first non-empty milestone).
Pull request base ref, if it matches release/X.Y[.Z].
Fall back to main.
This is the linchpin. Milestones in the product repo map cleanly to release branches in the docs repo. When the agent finally runs, it knows exactly where the docs should land without any creative writing about target branches or guessing.
The agent reads the diff, scans linked issues, and decides: does this need docs? If yes, it drafts the actual content in a checked-out microsoft/aspire.dev workspace, following our existing doc-writer skill (voice, MDX conventions, Starlight components). It then emits a create_pull_request safe-output and hands off.
The safe-outputs handler takes over:
Title prefix: [docs]
Label: docs-from-code
draft: true (we never auto-merge)
Base branch: agent-supplied, restricted to main or release/*
Target repo: microsoft/aspire.dev
Reviewer: the SME identified from the source pull request’s reviews—i.e., whoever the product team trusted to approve the feature, now gets asked to approve the doc for that feature.
A companion job posts a marker comment back on the source pull request with the docs pull request link and minimizes any older pr-docs-check comments on re-run. The engineer who just hit Merge gets a notification within a few minutes: “Here’s the docs draft. Look it over?”
The safe-outputs contract
The whole security story comes down to a small, boring stretch of frontmatter:
tools:
github:
toolsets: [repos, issues, pull_requests]
min-integrity: approved # only run pinned, integrity-checked actions
allowed-repos:
- microsoft/*
github-app:
app-id: ${{ secrets.ASPIRE_BOT_APP_ID }}
private-key: ${{ secrets.ASPIRE_BOT_PRIVATE_KEY }}
owner: "microsoft"
repositories: ["aspire.dev", "aspire"]
safe-outputs:
create-pull-request:
title-prefix: "[docs] "
labels: [docs-from-code]
draft: true # human-in-the-loop, always
base-branch: main
allowed-base-branches: [main, release/*]
target-repo: "microsoft/aspire.dev"
protected-files: blocked # AGENTS.md, manifests, security config: hands off
fallback-as-issue: true
That’s the deal in plain text. The agent gets a GitHub App token whose installation is scoped to exactly two repositories—the product repo and the docs repo—and nothing else in the org is reachable. It can only land pull requests against main or release/*. AGENTS.md and dependency manifests are off-limits by policy. If the pull request creation fails (network blip, conflict, anything), the framework falls back to filing an issue, so nothing is silently dropped.
This is the part security review actually liked. The agent’s reasoning is fuzzy. The action surface is not.
By the numbers
Here are the stats from a rolling 30-day window (May 3 – June 2, 2026) spanning the back end of the Aspire 13.3 release and the run-up to 13.4:
Metric Value
Product pull requests merged in microsoft/aspire 396 (338 main / 50 release/13.3 / 8 release/13.2)
pr-docs-check workflow runs 396
Draft docs pull requests created on microsoft/aspire.dev 82
– Merged 82 (100%)
– Closed without merge 0
– Still open 0
Docs pull requests target branches 52 → release/13.3, 27 → release/13.4, 3 → main
Median time-to-merge (docs) 44.8 hours
Merged within 24 h / 7 days 38% / 96%
Note: Numbers captured at the time of writing; the workflows keep running, so the totals only go up.
A few of those numbers deserve a second look:
396 runs → 82 pull requests is not a defect. The workflow runs on every merged pull request; most of them are internal refactors, test fixes, or dependency bumps with no user-facing surface. The agent saying “no docs needed” 300+ times is a feature.
100% merge rate says the agent’s docs picks are right. The tighter prompt we shipped after the v1 false-positive phase is paying off.
✅ What worked, ❌ what didn’t
What worked
✅ Milestone → release-branch mapping. This was the single highest-leverage choice we made. Engineers already set milestones on pull requests and issues; we got accurate target-branch routing for free.
✅ Draft-only, SME-as-reviewer. The agent never merges. The engineer who shipped the feature is the one who confirms the docs are right. We’ve stopped reverse-engineering features at the doc layer. The engineer just tells the docs draft what to say, in the place where they already are.
✅ Scoped GitHub app per workflow. Each workflow gets its own app token with explicit repo and permission scopes. Security review approved. We approved too; the first time we needed to rotate keys.
✅ protected-files: blocked. The agent cannot touch AGENTS.md, package manifests, or repo security config. Period.
What didn’t (at first)
❌ The agent’s “is this docs-worthy?” gate was too generous in the first version. It drafted pull requests for changes that were genuinely internal, such as a CI tweak or a logging refactor. The result: 9 closures of 69 pull requests (≈13%), so we tightened the prompt’s user-facing-change definition and added explicit negative examples (CI, internal helpers, tests-only). Now, the rate is trending down.
❌ Cross-repo pull request creation needed a mirrored checkout pattern that wasn’t obvious from the docs. The agent works in one repo; safe-outputs needs to find the target repo to push a branch. We solved it by checking out microsoft/aspire.dev twice—once as the current workspace, once under _repos/aspire.dev—so the safe-outputs handler can rediscover it deterministically.
❌ Big diffs blow prompt budgets. We pre-extract pull request metadata (linked issues, milestone, base ref) in pre-agent-steps bash, so the agent gets a small, structured summary instead of a giant payload. This is GitHub Agentic Workflow’s designed-in pattern, and it works.
Wrapping up
The changes we made shifted our thinking. A feature wasn’t considered done until the docs were. Docs no longer trail along behind it like a tin can on a string. The engineer’s review is the gate; the bot does the typing.
Critically, this doesn’t replace docs writers; it un-burdens them. Our writers used to spend most of their time reverse-engineering features. Now they spend their time on the things only a human can do well: narrative pages, sample programs, conceptual walkthroughs, the parts of the docs that don’t fall out of a diff. The bot handles the mechanical “this new option was added; here’s the reference page update” work that was never enjoyable for anyone.
Huge thanks to the GitHub Next team for GitHub Agentic Workflows (and for making the safe-outputs primitive a first-class part of the design), and to Chris Swithinbank and the Starlight maintainers for the docs platform we automate into. A genuine thank-you, too, to the security folks whose guardrails forced us to design this the right way the first time. The boring secret of good automation is that strong security constraints make the system more trustworthy and more correct.
If you build a product in one repo and ship docs in another—and especially if you have to do it inside any nontrivial security boundary—GitHub Agentic Workflows is worth a serious look. Start with one workflow, such as pr-docs-check, and watch what happens to your median time-to-docs.
The other workflows
pr-docs-check is the one I wrote this post about, but it’s not running alone. If you’re curious about the rest, the source is public:
milestone-changelog.md: runs every two hours, picks up newly merged pull requests in the active milestone, and maintains a 13.x-Change-log wiki page (new features, improvements, notable bug fixes) with a companion editorial-feedback issue. 346 runs.
release-update-support-mdx.md: on a stable Aspire release, drafts a [support] pull request on aspire.dev that updates the support policy page (promotes the new version, demotes the previous one, refreshes the “Last updated” badge).
update-integration-data.md: lives in the docs repo; runs pnpm update:all daily, refreshes NuGet metadata + GitHub stats + sample data, and opens a chore: Update integration data PR with supersede-and-close logic for stale runs. 27 runs, eight merged pull requests.
repo-pulse.md: a rolling three-day repo dashboard pinned to a single issue and updated in place: recent merges, pull requests awaiting review, new issues, discussion activity. One issue, always fresh.
Happy automating, friends! 烙
The post Automating cross-repo documentation with GitHub Agentic Workflows appeared first on The GitHub Blog.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み