Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
GitHub Docs

Using Copilot to work on an issue

Learn how to assign issues to GitHub Copilot, monitor progress as Copilot works on the issue, and then use pull request review comments to prompt Copilot to iterate on its work.

Who can use this feature?

Copilot coding agent is available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business and GitHub Copilot Enterprise plans. The agent is available in all repositories, except where it has been explicitly disabled and repositories owned by managed user accounts.
Sign up for Copilot

Note

Copilot coding agent is in public preview and subject to change. During the preview, use of the feature is subject toGitHub Pre-release License Terms.

For an overview of Copilot coding agent, seeAbout Copilot coding agent.

Introduction

You can assign a GitHub issue to Copilot, just like you would with a human software developer. Copilot will start working on the issue, raise a pull request and when it's finished working, request a review from you. For more information, seeAbout Copilot coding agent.

If you haven't used Copilot to work on an issue before, you can find some useful advice for getting good results inBest practices for using Copilot to work on tasks.

Assigning an issue to Copilot

You can ask Copilot to start working on an issue by assigning the issue to Copilot.

You can assign an issue to Copilot:

Assigning an issue to Copilot on GitHub.com

You can assign an issue to Copilot on GitHub.com in exactly the same way as you assign another user.

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Issues.

    Screenshot of the main page of a repository. In the horizontal navigation bar, a tab, labeled "Issues," is outlined in dark orange.

  3. Open the issue that you want to assign to Copilot.

  4. In the right side menu, clickAssignees.

    Screenshot of the right sidebar of an issue. A header, labeled "Assignees", is outlined in dark orange.

  5. ClickCopilot from assignees list.

    Screenshot of "Assignees" window on an issue. Copilot is available in the list.

Tip

When you assign an issue to Copilot, it gets sent the issue title, description, and any comments that currently exist. After assigning the issue, Copilot will not be aware of, and therefore won't react to, any further comments that are added to the issue. If you have more information, or changes to the original requirement, add this as a comment in the pull request that Copilot raises.

You can also assign issues to Copilot from other places on GitHub.com:

  • From the list of issues on a repository's Issues page.
  • When viewing an issue in GitHub Projects.

Assigning an issue to Copilot via the GitHub API

You can assign issues to Copilot using the GraphQL API.

Creating and assigning a new issue

  1. Make sure you're authenticating with the API using a user token, for example a personal access token or a GitHub App user-to-server token.

  2. Verify that Copilot coding agent is enabled in the repository by checking if the repository'ssuggestedActors in the GraphQL API includes Copilot. Replaceocto-org with the repository owner, andocto-repo with the repository name.

    GraphQL
    query{  repository(owner:"octo-org",name:"octo-repo"){    suggestedActors(capabilities:[CAN_BE_ASSIGNED],first:100){      nodes{        login        __typename...on Bot{          id}...on User{          id}}}}}

    If Copilot coding agent is enabled for the user and in the repository, the first node returned from the query will have thelogin valuecopilot-swe-agent.

  3. Make a note of theid value of this login.

  4. Fetch the GraphQL global ID of the repository you want to create the issue in, replacingocto-org with the repository owner, andocto-repo with the repository name.

    GraphQL
    query{  repository(owner:"octo-org",name:"octo-repo"){    id}}
  5. Create the issue with thecreateIssue mutation. ReplaceREPOSITORY_ID with the ID returned from the previous step, andBOT_ID with the ID returned from the step before that.

    GraphQL
    mutation{  createIssue(input:{repositoryId:"REPOSITORY_ID",title:"Implement comprehensive unit tests",body:"DETAILS",assigneeIds:["BOT_ID"]}){    issue{      id      title      assignees(first:10){        nodes{          login}}}}}

Assigning an existing issue

  1. Make sure you're authenticating with the API using a user token, for example a personal access token or a GitHub App user-to-server token.

  2. Verify that Copilot coding agent is enabled in the repository by checking if the repository'ssuggestedActors in the GraphQL API includes Copilot. Replaceocto-org with the repository owner, andocto-repo with the repository name.

    GraphQL
    query{  repository(owner:"monalisa",name:"octocat"){    suggestedActors(capabilities:[CAN_BE_ASSIGNED],first:100){      nodes{        login        __typename...on Bot{          id}...on User{          id}}}}}

    If Copilot coding agent is enabled for the user and in the repository, the first node returned from the query will have thelogin valuecopilot-swe-agent.

  3. Fetch the GraphQL global ID of the issue you want to assign to Copilot, replacingmonalisa with the repository owner,octocat with the name and9000 with the issue number.

    GraphQL
    query{  repository(owner:"monalisa",name:"octocat"){    issue(number:9000){      id      title}}}
  4. Assign the existing issue to Copilot using thereplaceActorsForAssignable mutation. ReplaceISSUE_ID with the ID returned from the previous step, andBOT_ID with the ID returned from the step before that.

    GraphQL
    mutation{  replaceActorsForAssignable(input:{assignableId:"ISSUE_ID",actorIds:["BOT_ID"]}){    assignable{...on Issue{        id        title        assignees(first:10){          nodes{            login}}}}}}

Tracking Copilot's progress on your issue

Shortly after you assign an issue to Copilot, Copilot will leave an 👀 reaction on the issue.

Screenshot of an issue assigned to Copilot. Copilot has left an eyes icon reaction.

A few seconds later, Copilot will open a draft pull request, linked to your original issue. An event will appear in the issue's timeline, linking to the pull request.

Screenshot of an issue with a timeline event showing that a linked pull request has been opened.

Copilot will start anagent session to work on your issue. A "Copilot started work" event will appear in the pull request timeline, and as Copilot works, it will update the pull request body with regular status updates, and push commits to the branch.

All of your sessions, past and present, can be seen and tracked from theAgents page. SeeTracking Copilot's sessions.

Screenshot of a pull request with a series of timeline events, including "Copilot started work."

If you want to check what Copilot is doing, clickView session. The session log viewer is displayed, showing you a live log as Copilot works on the issue. If you want to stop Copilot from working on the issue, clickStop session. SeeTracking Copilot's sessions.

Once Copilot has finished, the agent session will end, and Copilot will request a review from you, triggering a notification. In addition, a "Copilot finished work" event will appear in the pull request timeline.

Screenshot of a pull request timeline with "Copilot requested review" and "Copilot finished work" events.

Working with Copilot on a pull request

After Copilot has finished working on the issue, you should review the pull request thoroughly and comment on anything that needs changed. SeeReviewing a pull request created by Copilot.

Further reading


[8]ページ先頭

©2009-2025 Movatter.jp