Skip to content

Use GitHub Copilot CLI to automate PR title, description, and labels #2

@MariusStorhaug

Description

Context

The MVP uses a static PR title, description, and label for all managed-file PRs. While this is functional, the PR Manager Copilot agent (defined at PSModule/.github-private/agents/pr-manager.md) could generate richer, context-aware PR metadata by reading the diff and understanding which file sets were synced.

Proposal

Integrate the GitHub Copilot CLI (gh copilot) into the sync workflow to trigger the existing organization-level PR Manager agent after creating a draft PR. The agent would:

  1. Read the PR diff to understand what files changed.
  2. Set the PR title using the format ⚙️ [Maintenance]: <descriptive summary> (e.g., "⚙️ [Maintenance]: Update linter settings and custom instructions").
  3. Write a release-note-style description with context about which file sets were synced, linking back to the source repo.
  4. Apply the NoRelease label (since Maintenance maps to NoRelease in the agent's change type table).

Implementation notes

  • Create a structured prompt template at scripts/prompts/sync-pr.md that provides file-sync-specific context (target repo, type, file sets included, files changed, source repo link).
  • The script fills template variables at runtime ({{owner}}, {{repo}}, {{type}}, {{fileSets}}, {{fileList}}) and passes the rendered prompt to the agent.
  • The change type is always Maintenance — the prompt should instruct the agent not to auto-detect.
  • The agent is triggered after the draft PR is created and before it is marked as ready for review.
  • Exact CLI syntax: gh copilot agent pr-manager "$renderedPrompt" --repo {owner}/{repo} (may need adjustment based on CLI version).

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions