Skip to content

ci: request a Copilot review once CI first passes on a PR to main - #196

Open
alongd wants to merge 1 commit into
mainfrom
copilot-review-on-green
Open

ci: request a Copilot review once CI first passes on a PR to main#196
alongd wants to merge 1 commit into
mainfrom
copilot-review-on-green

Conversation

@alongd

@alongd alongd commented Aug 22, 2026

Copy link
Copy Markdown
Member

What

Adds .github/workflows/copilot-review.yml: the first time a PR to main passes CI, it requests a Copilot code review — once.

How

Listens on workflow_run for the CI workflow completing with conclusion == success on a pull_request, resolves the PR (event payload for same-repo PRs; head-SHA lookup for forks), and adds copilot-pull-request-reviewer[bot] as a reviewer. A dedup check (skip if Copilot is already requested or has already reviewed) keeps it to one pass per PR — it does not re-fire on later green pushes.

Why gated on green, not a ruleset

A copilot_code_review branch ruleset can only fire on PR open or on every push — it cannot wait for CI. Gating on green keeps Copilot off red branches and off the quota until the branch actually builds, and holds it to a single review.

Notes

  • Config-only: no change to ci.yml or any source/test.
  • The listener activates once this is on main; it takes effect on the next PR.
  • permissions: pull-requests: write, contents: read.

Copilot AI left a comment

Copy link
Copy Markdown

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 GitHub Actions workflow that requests a GitHub Copilot code review automatically the first time CI succeeds for a PR targeting main, using workflow_run as the trigger and dedup logic to keep it to one review per PR.

Changes:

  • Introduces .github/workflows/copilot-review.yml to listen for successful T3 CI runs on PRs.
  • Resolves the associated PR (payload for same-repo PRs; head-SHA lookup fallback for forks) and requests copilot-pull-request-reviewer[bot].
  • Skips requesting if Copilot is already requested or has already reviewed.

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

Comment thread .github/workflows/copilot-review.yml
Comment thread .github/workflows/copilot-review.yml Outdated
Comment thread .github/workflows/copilot-review.yml
@alongd
alongd force-pushed the copilot-review-on-green branch from 7940359 to a05edbc Compare August 22, 2026 20:39
@codecov-commenter

codecov-commenter commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.71%. Comparing base (25378f4) to head (63f68d3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #196      +/-   ##
==========================================
+ Coverage   82.69%   82.71%   +0.01%     
==========================================
  Files          72       72              
  Lines       11709    11720      +11     
  Branches     2524     2526       +2     
==========================================
+ Hits         9683     9694      +11     
  Misses       1434     1434              
  Partials      592      592              
Flag Coverage Δ
unittests 82.71% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alongd
alongd force-pushed the copilot-review-on-green branch 2 times, most recently from 31eacff to 63f68d3 Compare August 23, 2026 13:26
Adds .github/workflows/copilot-review.yml. It listens on workflow_run for the
"T3 CI" workflow completing successfully and, for a PR targeting main, requests
a Copilot code review exactly once — the first time CI is green. A dedup check
(skip if Copilot is already a requested reviewer or has already reviewed) keeps
it to a single pass rather than re-firing on every subsequent green push.

Chosen over a copilot_code_review branch ruleset, which can only fire on PR open
or on every push and cannot gate on CI passing — so it would review red branches
and burn Copilot's premium-request quota on them.
@alongd
alongd force-pushed the copilot-review-on-green branch from 63f68d3 to a2d6b54 Compare August 23, 2026 16:27
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.

3 participants