OpenCoze
Back to template library

Automate Pull Request Review and Labeling with GitHub Copilo

DevelopmentCozeUpdated 2026-04-16

Automatically generate pull request review comments and apply labels using GitHub Copilot CLI and GitHub Actions to boost developer productivity.

System Prompt
When a new pull request is opened in {repo}, run Copilot CLI to generate review comments based on {review_template}. Post the review as {reviewer} and apply the label {label}. Then notify the team via {notification_channel}.

Variable Dictionary (fill in your AI tool)

This section only explains placeholders. It is not an input form on this website. Copy the prompt, then replace variables in Coze / Dify / ChatGPT.

{repo}

Full repository name, e.g., example/repo

Filling hint: replace this with your real business context.

{pr_number}

Pull request number

Filling hint: replace this with your real business context.

{reviewer}

Reviewer username or bot name

Filling hint: replace this with your real business context.

{review_template}

Copilot review template name, e.g., standard

Filling hint: replace this with your real business context.

{label}

Label to add, e.g., needs-review

Filling hint: replace this with your real business context.

{notification_channel}

Notification channel URL, e.g., Slack Webhook

Filling hint: replace this with your real business context.

Quick Variable Filler (Optional)

Fill variables below to generate a ready-to-run prompt in your browser.

{repo}

Full repository name, e.g., example/repo

{pr_number}

Pull request number

{reviewer}

Reviewer username or bot name

{review_template}

Copilot review template name, e.g., standard

{label}

Label to add, e.g., needs-review

{notification_channel}

Notification channel URL, e.g., Slack Webhook

Generated Prompt Preview

Missing: 6
When a new pull request is opened in {repo}, run Copilot CLI to generate review comments based on {review_template}. Post the review as {reviewer} and apply the label {label}. Then notify the team via {notification_channel}.

How to Use This Template

Best for

Teams that need faster development output with more stable prompt quality.

Problem it solves

Reduces blank-page time, missing constraints, and inconsistent output structure from ad-hoc prompting.

Steps

  1. Copy the template prompt.
  2. Paste it into your AI tool (Coze / Dify / ChatGPT).
  3. Replace placeholder variables using the dictionary above.
  4. Run and refine constraints based on output quality.

Not ideal when

You need live web retrieval, database writes, or multi-step tool orchestration. Use full workflow automation for that.

Success Case

Input:
repo=example/repo, pr_number=42, reviewer=bot, review_template=standard, label=needs-review, notification_channel=https://hooks.slack.com/services/...
Output:
Review posted, label added, notification sent

Boundary Case

Input:
Missing GITHUB_TOKEN environment variable
Fix:
Set the GITHUB_TOKEN environment variable and retry

What to Try Next

Keep exploring with similar templates and matching tools.

Continue Where You Left Off

No recent items yet.

Workflow Steps

  1. 1. Listen for PR open event to capture {repo} and {pr_number}

  2. 2. Run Copilot CLI: copilot review --repo {repo} --pr {pr_number} --template {review_template} and capture output

  3. 3. Submit review via GitHub CLI: gh pr review {pr_number} --comment "{review_output}" --body "Automated review"

  4. 4. Add label to PR: gh pr edit {pr_number} --add-label {label}

  5. 5. Send notification: curl -X POST {notification_channel} -d "PR #{pr_number} has been automatically reviewed and labeled {label}"

Constraints

  • PR with no changes still generates an empty review
  • PR with a very large diff causes Copilot timeout
  • PR already has the same label to avoid duplicate addition

Explore More in This Category

Development

Recommended Stack

Tools that work well with this template.

Coze

Official site

Low-code agent workflow platform for fast automation delivery.

Open

OpenAI

Official site

General LLM platform for generation, analysis, and development use cases.

Open