|
| 1 | +--- |
| 2 | +title: Using Copilot to explore pull requests |
| 3 | +shortTitle: Explore pull requests |
| 4 | +intro: '{% data variables.copilot.copilot_chat %} can help you understand the content, functionality, and status of a pull request.' |
| 5 | +topics: |
| 6 | + - Copilot |
| 7 | +versions: |
| 8 | + feature: copilot |
| 9 | +--- |
| 10 | + |
| 11 | +## Introduction |
| 12 | + |
| 13 | +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. |
| 14 | + |
| 15 | +## Get a summary of a pull request |
| 16 | + |
| 17 | +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. |
| 18 | + |
| 19 | +1. On {% data variables.product.github %}, navigate to a pull request in a repository. |
| 20 | +{% data reusables.copilot.open-chat-panel %} |
| 21 | +{% data reusables.copilot.chat-previous-conversation %} |
| 22 | +1. At the bottom of the {% data variables.copilot.copilot_chat_short %} panel, in the prompt box, type a question and press <kbd>Enter</kbd>. |
| 23 | + |
| 24 | +### Example prompts |
| 25 | + |
| 26 | +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. |
| 27 | + |
| 28 | +* `Summarize this pull request` |
| 29 | +* `What is the current status of this pull request?` |
| 30 | +* `What are the main changes in this pull request?` |
| 31 | + |
| 32 | +## Ask about changes to a specific file in a pull request |
| 33 | + |
| 34 | +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. |
| 35 | + |
| 36 | +1. On {% data variables.product.github %}, navigate to a pull request in a repository. |
| 37 | +1. Click the **Files changed** tab. |
| 38 | +1. Click {% octicon "kebab-horizontal" aria-label="Show options" %} at the top right of the file, then click **Ask {% data variables.product.prodname_copilot_short %} about this diff**. |
| 39 | +1. Type a question in the prompt box at the bottom of the chat panel and press <kbd>Enter</kbd>. |
| 40 | + |
| 41 | +### Example prompts |
| 42 | + |
| 43 | +* `What are the changes in this file?` |
| 44 | +* `What is the status of this file in the pull request?` |
| 45 | + |
| 46 | +## Ask about specific lines within a file in a pull request |
| 47 | + |
| 48 | +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. |
| 49 | + |
| 50 | +1. On {% data variables.product.github %}, navigate to a pull request in a repository. |
| 51 | +1. Click the **Files changed** tab. |
| 52 | +1. Click the line number for the first line you want to select, then hold down <kbd>Shift</kbd> and click the line number for the last line you want to select. |
| 53 | +1. Ask {% data variables.product.prodname_copilot_short %} a question, or choose from a list of predefined questions. |
| 54 | + * _To ask your own question about the selected lines_, to the right of your selection, click the {% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %} icon. |
| 55 | + This displays the {% data variables.copilot.copilot_chat %} panel with the selected lines indicated as the context of your question. |
| 56 | + |
| 57 | +### Example prompts |
| 58 | + |
| 59 | +* `Explain the selected lines of code` |
| 60 | +* `What do these lines of code do?` |
| 61 | + |
| 62 | +## Ask why a workflow has failed |
| 63 | + |
| 64 | +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. |
| 65 | + |
| 66 | +1. On {% data variables.product.github %}, navigate to a pull request in a repository. |
| 67 | +1. Scroll to the bottom of the page, then, next to one of the failing checks, click **Details**. |
| 68 | +{% data reusables.copilot.open-chat-panel %} |
| 69 | +{% data reusables.copilot.chat-previous-conversation %} |
| 70 | +1. At the bottom of the {% data variables.copilot.copilot_chat_short %} panel, in the prompt box, ask {% data variables.product.prodname_copilot_short %} why the pull request has failed and press <kbd>Enter</kbd>. |
| 71 | + |
| 72 | + {% 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. |
| 73 | + |
| 74 | +1. If {% data variables.product.prodname_copilot_short %} has provided steps to fix the issue, you can follow the steps to resolve the problem. |
| 75 | + |
| 76 | +### Example prompts |
| 77 | + |
| 78 | +* `Why has this workflow failed?` |
| 79 | +* `What can I do to fix this issue?` |
| 80 | + |
| 81 | +## Further reading |
| 82 | + |
| 83 | +* [AUTOTITLE](//copilot/tutorials/using-copilot-to-explore-a-codebase) |
0 commit comments