Skip to content

ci: migrate PR comment workflows - #1531

Merged
aaronpowell merged 1 commit into
mainfrom
aaronpowell-pr-comment-workflows
Aug 19, 2026
Merged

ci: migrate PR comment workflows#1531
aaronpowell merged 1 commit into
mainfrom
aaronpowell-pr-comment-workflows

Conversation

@aaronpowell

Copy link
Copy Markdown
Member

Closes N/A

Fork-originated pull requests cannot use a pull_request token to write comments. This replaces the privileged pull_request_target flows with a read-only analyzer and a validated workflow_run writer.

The integration code-owner prompt and dogfooding comment now publish minimal PR artifacts from pull_request workflows. Their writers validate the artifact schema, originating run, PR association, repository/ref, and current head SHA before writing or updating comments. Manual dogfooding dispatch remains available.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration (N/A)
    • Docs are written (N/A)
    • Added description of major feature to project description for NuGet package (N/A)
  • Tests for the changes have been added (for bug fixes / features) (N/A - workflow configuration change)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs (N/A)
  • Code follows all style conventions

Other information

The privileged writers intentionally do not check out or execute pull request code. No pull_request_target triggers remain in .github/workflows.

Use read-only pull_request workflows with validated workflow_run writers for privileged PR comments.

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

Copilot-Session: 188db381-e6de-44dd-9255-8a78feee74ac
Copilot AI lite review requested due to automatic review settings August 19, 2026 06:13
@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/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1531

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1531"

@aaronpowell aaronpowell added the skip-nuget-publish Skips publishing to NuGet when merging to the `main` branch. label Aug 19, 2026
@aaronpowell
aaronpowell merged commit fc4716b into main Aug 19, 2026
14 checks passed
@aaronpowell
aaronpowell deleted the aaronpowell-pr-comment-workflows branch August 19, 2026 06:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates two PR-commenting automations away from pull_request_target into a split design: a low-privilege pull_request workflow that publishes minimal artifacts, plus a privileged workflow_run writer that validates the artifact and PR/run association before creating/updating comments. This fits the repo’s CI hardening goals for fork-originated PRs while preserving automated PR feedback.

Changes:

  • Replaced pull_request_target comment writers with read-only pull_request “prepare” jobs that emit validated JSON artifacts.
  • Added workflow_run writer workflows for both integration code-owner prompts and dogfooding comments, with schema and PR/run/head-SHA validation prior to writing.
  • Kept manual dogfooding dispatch available while ensuring privileged writers do not check out or execute PR code.
Show a summary per file
File Description
.github/workflows/integration-codeowner.yml Switches from privileged PR-commenting to artifact emission from pull_request (read-only).
.github/workflows/integration-codeowner-writer.yml New workflow_run writer that validates the artifact/run/PR association before posting/updating the prompt comment.
.github/workflows/dogfood-comment.yml Replaces direct PR commenting with artifact emission on pull_request, retaining a manual dispatch path.
.github/workflows/dogfood-comment-writer.yml New workflow_run writer that validates the artifact/run/PR association before posting/updating the dogfooding comment.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

on:
pull_request_target:
pull_request:
types: [opened, ready_for_review, reopened]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-nuget-publish Skips publishing to NuGet when merging to the `main` branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants