Skip to content

Comments

Agentic workflow for submitting documentation PRs#37765

Closed
roji wants to merge 1 commit intodotnet:mainfrom
roji:CreateDocsAutomation
Closed

Agentic workflow for submitting documentation PRs#37765
roji wants to merge 1 commit intodotnet:mainfrom
roji:CreateDocsAutomation

Conversation

@roji
Copy link
Member

@roji roji commented Feb 21, 2026

No description provided.

@roji roji requested a review from a team as a code owner February 21, 2026 07:49
Copilot AI review requested due to automatic review settings February 21, 2026 07:49
Copy link

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 a new agentic GitHub Actions workflow intended to generate documentation changes and open draft PRs against dotnet/EntityFramework.Docs when triggered via a /doc slash command on an issue comment.

Changes:

  • Added a gh-aw workflow definition (create-docs-pr.md) describing the desired documentation PR behavior and authoring guidance.
  • Added the generated, locked GitHub Actions workflow (create-docs-pr.lock.yml) that executes Copilot CLI + safe-outputs to create PRs/comments.
  • Marked *.lock.yml workflows as generated in .gitattributes (and configured merge behavior), and added an actions SHA lock file under .github/aw/.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
.github/workflows/create-docs-pr.md Source gh-aw markdown workflow definition and instructions for authoring docs PRs.
.github/workflows/create-docs-pr.lock.yml Generated workflow implementation (jobs, permissions, safe-outputs plumbing).
.github/aw/actions-lock.json Locks specific action SHAs used by the workflow tooling.
.gitattributes Marks generated workflow lock files and sets merge strategy for them.

GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":true,\"fallback_as_issue\":false,\"max\":1,\"max_patch_size\":1024,\"reviewers\":[\"roji\"],\"target-repo\":\"dotnet/EntityFramework.Docs\"},\"missing_data\":{},\"missing_tool\":{}}"
with:
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The safe-outputs frontmatter declares github-token: ${{ secrets.ROJI_TOKEN }} for creating PRs in dotnet/EntityFramework.Docs, but the actions/github-script step running safe_output_handler_manager.cjs uses ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}. GITHUB_TOKEN typically won’t have access to a different repository, so PR creation may fail unless GH_AW_GITHUB_TOKEN is specially provisioned. Consider using the same cross-repo token (or a GitHub App token) for the handler step as well.

Suggested change
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.ROJI_TOKEN }}

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +13
issues: read
pull-requests: read
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The frontmatter permissions are set to read-only, but this workflow needs to write (e.g., add reactions/comments on the triggering issue and create PRs). Please update the declared permissions to match what the generated workflow actually requires (at minimum issues: write and likely pull-requests: write, discussions: write if used), so future recompiles/maintenance don’t drift or confuse reviewers.

Suggested change
issues: read
pull-requests: read
issues: write
pull-requests: write

Copilot uses AI. Check for mistakes.
```

* Find the "what's new" page for the latest major release (typically `core/what-is-new/ef-core-11.0`, adjusting for the version), and add a **brief** section on the feature - just the minimum needed to make the user understand what it's about; include a minimal code sample as well if relevant. At the bottom, add a line such as "For more information on X, see the documentation" linking to the full docs added above.
* For both the full docs and the what's new documentation, do not simply create a new section; first check to see if there's an existing section that already covers related/similar functionality; if there is, either merge the new content into it or place the new section new to it.
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

This sentence is grammatically incorrect: "place the new section new to it". It reads like a typo and should be corrected (e.g., "next to it").

Suggested change
* For both the full docs and the what's new documentation, do not simply create a new section; first check to see if there's an existing section that already covers related/similar functionality; if there is, either merge the new content into it or place the new section new to it.
* For both the full docs and the what's new documentation, do not simply create a new section; first check to see if there's an existing section that already covers related/similar functionality; if there is, either merge the new content into it or place the new section next to it.

Copilot uses AI. Check for mistakes.
## Additional instructions

* The commit in the submitted PR should have a title of the form "Document X", where X is the name of the feature as it appears in the title of the originating issue. If the title is too long, for a git commit, make it shorter. The commit body should be of the form "Document Y", where Y is a link to the originating issue.
* If you encounter any error or issue, post a comment on the triggering PR detailing the problem(s) you encountered.
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

This workflow is triggered for issue comments (and explicitly excludes PR comments). The instruction to "post a comment on the triggering PR" is inconsistent; it should refer to the triggering issue (or the triggering discussion, if supported).

Suggested change
* If you encounter any error or issue, post a comment on the triggering PR detailing the problem(s) you encountered.
* If you encounter any error or issue, post a comment on the triggering issue detailing the problem(s) you encountered.

Copilot uses AI. Check for mistakes.
(needs.pre_activation.outputs.activated == 'true') && (((github.event_name == 'issue_comment') && ((github.event_name == 'issue_comment') &&
(((startsWith(github.event.comment.body, '/doc ')) || (github.event.comment.body == '/doc')) && (github.event.issue.pull_request == null)))) ||
(!(github.event_name == 'issue_comment')))
runs-on: ubuntu-slim
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

runs-on: ubuntu-slim isn’t a standard GitHub-hosted runner label (unlike ubuntu-latest/ubuntu-24.04). Unless this repo has a self-hosted runner labeled ubuntu-slim, these jobs will fail to start. Consider switching to a GitHub-hosted runner label or explicitly using self-hosted with the appropriate labels.

Suggested change
runs-on: ubuntu-slim
runs-on: ubuntu-latest

Copilot uses AI. Check for mistakes.
repository: dotnet/EntityFramework.Docs
token: ${{ secrets.ROJI_TOKEN }}
persist-credentials: false
fetch-depth: 1
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The workflow instructions say to target a docs-repo branch derived from the issue’s preview/rc label, but this checkout step doesn’t specify ref: and uses fetch-depth: 1, which will only fetch the default branch. If the PR needs to be based on / target a non-default branch, the checkout should fetch and checkout that branch (and/or fetch all refs needed).

Suggested change
fetch-depth: 1
ref: ${{ github.ref_name }}
fetch-depth: 0

Copilot uses AI. Check for mistakes.
Comment on lines +1195 to +1196
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1},\"create_pull_request\":{\"base_branch\":\"${{ github.ref_name }}\",\"draft\":true,\"fallback_as_issue\":false,\"max\":1,\"max_patch_size\":1024,\"reviewers\":[\"roji\"],\"target-repo\":\"dotnet/EntityFramework.Docs\"},\"missing_data\":{},\"missing_tool\":{}}"
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG hardcodes create_pull_request.base_branch to ${{ github.ref_name }}, which won’t match the documented requirement to choose the docs target branch from the issue’s preview/rc label. This will likely create docs PRs against the wrong base branch. Consider removing this hardcoded base branch and letting the agent/tool supply the computed base branch, or compute it in the workflow before calling the safe outputs handler.

Copilot uses AI. Check for mistakes.
@roji
Copy link
Member Author

roji commented Feb 21, 2026

Closing in favor of dotnet/EntityFramework.Docs#5274, as @AndriySvyryd prefers we don't use slash commands.

@roji roji closed this Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants