5.2 KiB
title, shortTitle, intro, topics, versions, redirect_from, contentType, category
| title | shortTitle | intro | topics | versions | redirect_from | contentType | category | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Using GitHub Copilot to explore pull requests | Explore pull requests | {% data variables.copilot.copilot_chat %} can help you understand the content, functionality, and status of a pull request. |
|
|
|
tutorials |
|
Introduction
You can ask {% data variables.product.prodname_copilot_short %} different questions about a pull request, from different views within the pull request. For example, you can ask {% data variables.product.prodname_copilot_short %} to summarize a pull request, or explain what has changed within specific files or lines of code in a pull request.
Get a summary of a pull request
You can ask {% data variables.product.prodname_copilot_short %} to summarize a pull request, or to provide information about the status of a pull request.
-
On {% data variables.product.github %}, navigate to a pull request in a repository.
-
In the top right corner of the page, click the {% data variables.product.prodname_copilot_short %} icon ({% octicon "copilot" aria-label="Copilot icon" %}) to open {% data variables.copilot.copilot_chat_short %}.
{% data variables.product.prodname_copilot_short %} will use the pull request as context for your question.
-
At the bottom of the {% data variables.copilot.copilot_chat_short %} panel, in the prompt box, type a question and press Enter.
Example prompts
The following prompts are examples of the kind of questions you can ask {% data variables.product.prodname_copilot_short %} to help you find out about a pull request.
Summarize this pull requestWhat is the current status of this pull request?What are the main changes in this pull request?
Ask about changes to a specific file in a pull request
You can ask {% data variables.product.prodname_copilot_short %} to explain the changes made to a specific file in a pull request, or to provide information about the status of a file in a pull request.
-
On {% data variables.product.github %}, navigate to a pull request in a repository.
-
Click the Files changed tab.
-
To the right side of a line in the file you want to ask about, click the {% octicon "triangle-down" aria-hidden="true" aria-label="Show file actions" %} icon, then click {% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}, and select Ask about this diff.
This opens {% data variables.copilot.copilot_chat_short %} with the file changes indicated as the context of your question.
-
Type a question in the prompt box at the bottom of the chat panel and press Enter.
Example prompts
What are the changes in this file?What is the status of this file in the pull request?
Ask about specific lines within a file in a pull request
You can ask {% data variables.product.prodname_copilot_short %} to explain specific lines of code in a pull request, or to provide information about the status of those lines.
-
On {% data variables.product.github %}, navigate to a pull request in a repository.
-
Click the Files changed tab.
-
Click the line number for the first line you want to select, then hold down Shift and click the line number for the last line you want to select.
-
To the right side of one of the selected lines, click the {% octicon "triangle-down" aria-hidden="true" aria-label="Show file actions" %} icon, then click {% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}, and select Ask about this diff.
This opens {% data variables.copilot.copilot_chat_short %} with the selected lines indicated as the context of your question.
-
Type a question in the prompt box at the bottom of the chat panel and press Enter.
Example prompts
Explain the selected lines of codeWhat do these lines of code do?
Ask why a workflow has failed
You can ask {% data variables.product.prodname_copilot_short %} to explain why a workflow has failed in a pull request, and provide suggestions for how to fix the issue.
-
On {% data variables.product.github %}, navigate to a pull request in a repository.
-
Scroll to the bottom of the page, then, next to one of the failing checks, click the ellipsis, and then click {% octicon "copilot" aria-hidden="true" aria-label="copilot" %} Explain error.
This opens {% data variables.copilot.copilot_chat_short %} with the workflow failure indicated as the context of your question and a prompt pre-filled in the chat input box. {% data variables.product.prodname_copilot_short %} responds with information about why the pull request failed. {% data variables.product.prodname_copilot_short %} may also provide suggestions for how to fix the issue.
-
If {% data variables.product.prodname_copilot_short %} has provided steps to fix the issue, you can follow the steps to resolve the problem.
Example prompts
Why has this workflow failed?What can I do to fix this issue?