Skip to content

Add a shared workflow to request a Copilot review - #202

Merged
Jesse Hills (jesserockz) merged 1 commit into
mainfrom
jesserockz-2026-989
Nov 19, 2026
Merged

Jesse Hills (jesserockz) merged 1 commit into
mainfrom
jesserockz-2026-989

Conversation

@jesserockz

Copy link
Copy Markdown
Member

Adds request-copilot-review.yml, a reusable workflow that requests a Copilot review as esphome-review-bot, and its script with tests. Several repositories run their own copy of this on pull_request_target, which GitHub blocks by default from 2 December 2026 (esphome/backlog#211).

A caller runs it from workflow_run of the PR event doorbell, an hourly schedule (for doorbell runs held for approval) and workflow_dispatch. The find-prs job matches open pull requests by head repository and head commit, since a fork's run does not name its pull request. The request job reads each pull request fresh and requests a review once per pull request, or after each push with every-push: true. Skips are decided from reads only, so the hourly sweep writes nothing unless a request is needed.

Inputs: pr-number (for dispatch), base-branch (empty means any) and every-push. Secret: COPILOT_REVIEW_TOKEN.

A caller:

on:
  workflow_run:
    workflows: [PR event]
    types: [completed]
  schedule:
    - cron: "17 * * * *"
  workflow_dispatch:
    inputs:
      pr-number:
        description: Pull request number
        required: true

permissions: {}

jobs:
  request:
    name: Request Copilot review
    uses: esphome/workflows/.github/workflows/request-copilot-review.yml@<release>
    permissions:
      contents: read # the shared workflow checks out its own script
      pull-requests: read # the shared workflow lists open pull requests
    with:
      pr-number: ${{ inputs.pr-number }}
    secrets:
      COPILOT_REVIEW_TOKEN: ${{ secrets.COPILOT_REVIEW_TOKEN }}

Repositories can call it from the PR event doorbell instead of running their own pull_request_target copy, which GitHub blocks by default from 2 December 2026.
@jesserockz
Jesse Hills (jesserockz) merged commit 50b62ab into main Nov 19, 2026
55 checks passed
@jesserockz
Jesse Hills (jesserockz) deleted the jesserockz-2026-989 branch November 19, 2026 22:50
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.

1 participant