Skip to content

Stop PR Review Queue workflow from running on forks and @-pinging PR authors - #35751

Merged
PureWeen merged 2 commits into
mainfrom
pureween/fork-guard-pr-review-queue
Jun 3, 2026
Merged

Stop PR Review Queue workflow from running on forks and @-pinging PR authors#35751
PureWeen merged 2 commits into
mainfrom
pureween/fork-guard-pr-review-queue

Conversation

@PureWeen

@PureWeen PureWeen commented Jun 3, 2026

Copy link
Copy Markdown
Member

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!

Problem

Two issues with the daily "PR Review Queue" automation:

1. Workflow runs in forks and creates duplicate tracking issues

.github/workflows/pr-review-queue.yml had no fork guard, so the daily scheduled run (cron: "0 8 * * 1-5") was firing in active forks of dotnet/maui as well as in upstream. The gh issue create --repo ${{ github.repository }} step targets the running repo, so each fork ended up with its own [PR Review Queue] issue alongside the legitimate dotnet/maui one — e.g. PureWeen/maui#105 and dotnet/maui#35732 for the same day, both pinging the fork owner.

2. Every PR author gets @-mentioned daily

The markdown table emitted each PR author handle as a raw @username, which GitHub parses as a real mention. Each daily run created a new issue and notified every PR author — community contributors, partner devs, bots — even though the issue is purely an internal MAUI-team triage artifact.

Changes

.github/workflows/pr-review-queue.yml — Add the same github.repository_owner == 'dotnet' guard already used by 8 other dotnet-owned workflows in this repo (backport.yml, rebase.yml, locker.yml, dogfood-comment.yml, maestro-changelog.yml, inclusive-heat-sensor.yml, dotnet-format-daily.yml, dotnet-autoformat-pr-push.yml). Applied to both jobs:

  • generate-report — stops the scheduled issue creation on forks.
  • validate — stops fork-internal PRs from spending CI on the dry-run.

.github/skills/find-reviewable-pr/scripts/query-reviewable-prs.ps1 — Wrap author handles in backticks (`@username`) in all four table-row formats. GitHub does not parse mentions inside code spans, so no notifications fire, but the table still reads naturally as a list of author handles.

Verification

  • YAML parses cleanly (python3 -c "import yaml; yaml.safe_load(...)").
  • PowerShell escape verified — "``@$($pr.Author)``" renders as `@PureWeen`.
  • Existing renderer logic for $showMilestone / $showTurn variants left intact; only the author cell changed.

Out of scope

Other automation in this repo was checked and is already fork-safe:

  • The gh-aw *.lock.yml files (agentic-labeler, daily-repo-status, copilot-evaluate-tests) and agentics-maintenance.yml are auto-generated (DO NOT EDIT) and have their own pre-activation role checks.
  • review-trigger.yml is implicitly fork-safe via its actor-permission check.
bot and others added 2 commits June 3, 2026 09:09
The 'PR Review Queue' workflow had no fork guard, so the daily scheduled
run was firing in active forks (e.g. PureWeen/maui) and creating
duplicate '[PR Review Queue]' issues that pinged the fork owner.

Add the same 'github.repository_owner == "dotnet"' job-level guard
used by the other dotnet-owned workflows in this repo
(backport.yml, dogfood-comment.yml, rebase.yml, locker.yml,
maestro-changelog.yml, inclusive-heat-sensor.yml,
dotnet-format-daily.yml, dotnet-autoformat-pr-push.yml).

Applied to both jobs:
- generate-report: stops the scheduled issue creation on forks.
- validate: stops fork-internal PRs from spending CI on the dry-run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The daily 'PR Review Queue' issue is a MAUI-team triage artifact — not
a notification channel for every open PR's author. Each row in the
markdown table emitted '@username' verbatim, which GitHub rendered as
a real mention and pinged every PR author (community contributors,
partner devs, bots) each time the daily scheduled run fired and
created a new issue.

Wrap author handles in backticks (`@username`) so they render as
inline code. Visually still reads as a user reference, but GitHub does
not parse mentions inside code spans, so no notification is sent.

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

github-actions Bot commented Jun 3, 2026

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/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35751

Or

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

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Skill Validation Results

✅ Static Checks Passed

Skills checked: 18 | Agents checked: 4

Full validator output
Found 1 skill(s)
[find-reviewable-pr] 📊 find-reviewable-pr: 1,778 BPE tokens [chars/4: 1,722] (detailed ✓), 22 sections, 3 code blocks
✅ All checks passed (1 skill(s))
Found 4 agent(s)
Validated 4 agent(s)

✅ All checks passed (4 agent(s))

⏭️ LLM Evaluation: Skipped

No changed skills with eval tests found.

🔍 Full results and investigation steps

@github-actions github-actions Bot added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Jun 3, 2026
@PureWeen
PureWeen merged commit 45e2a4d into main Jun 3, 2026
20 of 21 checks passed
@PureWeen
PureWeen deleted the pureween/fork-guard-pr-review-queue branch June 3, 2026 16:46
@github-actions github-actions Bot added this to the .NET 10.0 SR8 milestone Jun 3, 2026
Dhivya-SF4094 pushed a commit to Dhivya-SF4094/maui that referenced this pull request Jun 15, 2026
…authors (dotnet#35751)

<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Problem

Two issues with the daily "PR Review Queue" automation:

### 1. Workflow runs in forks and creates duplicate tracking issues

`.github/workflows/pr-review-queue.yml` had no fork guard, so the daily
scheduled run (`cron: "0 8 * * 1-5"`) was firing in active forks of
dotnet/maui as well as in upstream. The `gh issue create --repo ${{
github.repository }}` step targets the running repo, so each fork ended
up with its own `[PR Review Queue]` issue alongside the legitimate
dotnet/maui one — e.g. `PureWeen#105` and `dotnet#35732` for
the same day, both pinging the fork owner.

### 2. Every PR author gets @-mentioned daily

The markdown table emitted each PR author handle as a raw `@username`,
which GitHub parses as a real mention. Each daily run created a new
issue and notified every PR author — community contributors, partner
devs, bots — even though the issue is purely an internal MAUI-team
triage artifact.

## Changes

**`.github/workflows/pr-review-queue.yml`** — Add the same
`github.repository_owner == 'dotnet'` guard already used by 8 other
dotnet-owned workflows in this repo (`backport.yml`, `rebase.yml`,
`locker.yml`, `dogfood-comment.yml`, `maestro-changelog.yml`,
`inclusive-heat-sensor.yml`, `dotnet-format-daily.yml`,
`dotnet-autoformat-pr-push.yml`). Applied to both jobs:
  - `generate-report` — stops the scheduled issue creation on forks.
- `validate` — stops fork-internal PRs from spending CI on the dry-run.


**`.github/skills/find-reviewable-pr/scripts/query-reviewable-prs.ps1`**
— Wrap author handles in backticks (`` `@username` ``) in all four
table-row formats. GitHub does not parse mentions inside code spans, so
no notifications fire, but the table still reads naturally as a list of
author handles.

## Verification

- YAML parses cleanly (`python3 -c "import yaml; yaml.safe_load(...)"`).
- PowerShell escape verified — `"``@$($pr.Author)``"` renders as ``
`@PureWeen` ``.
- Existing renderer logic for `$showMilestone` / `$showTurn` variants
left intact; only the author cell changed.

## Out of scope

Other automation in this repo was checked and is already fork-safe:
- The gh-aw `*.lock.yml` files (`agentic-labeler`, `daily-repo-status`,
`copilot-evaluate-tests`) and `agentics-maintenance.yml` are
auto-generated (`DO NOT EDIT`) and have their own pre-activation role
checks.
- `review-trigger.yml` is implicitly fork-safe via its actor-permission
check.

---------

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

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions

2 participants