Move Copilot variables from product.yml to copilot.yml (#55832)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hubwriter <54933897+hubwriter@users.noreply.github.com> Co-authored-by: hubwriter <hubwriter@github.com> Co-authored-by: felicitymay <1877141+felicitymay@users.noreply.github.com> Co-authored-by: Felix Guntrip <stevecat@github.com> Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com> Co-authored-by: Ebonsignori <17055832+Ebonsignori@users.noreply.github.com>
This commit is contained in:
@@ -54,7 +54,7 @@ Below the file preview, {% data variables.product.prodname_code_scanning %} prov
|
||||
|
||||
In our case, the recommendation is to sanitize user input before using it. This means we need to check the input for malicious code, then clean it up if necessary.
|
||||
|
||||
> [!TIP] If you don't fully understand the recommended fix, try [asking {% data variables.product.prodname_copilot_chat_short %}](https://github.com/copilot) to explain it.
|
||||
> [!TIP] If you don't fully understand the recommended fix, try [asking {% data variables.copilot.copilot_chat_short %}](https://github.com/copilot) to explain it.
|
||||
|
||||
### Timeline
|
||||
|
||||
@@ -64,9 +64,9 @@ Finally, you can see the timeline of the alert at the bottom of the page. Our ti
|
||||
|
||||
## Fixing a vulnerability automatically
|
||||
|
||||
To secure our project quickly and easily, let's use {% data variables.product.prodname_copilot_autofix %} for {% data variables.product.prodname_code_scanning %}.
|
||||
To secure our project quickly and easily, let's use {% data variables.copilot.copilot_autofix %} for {% data variables.product.prodname_code_scanning %}.
|
||||
|
||||
1. Below the alert title, in the box suggesting you "Speed up the remediation of this alert using {% data variables.product.prodname_copilot_autofix_short %} for {% data variables.product.prodname_codeql %}", click {% octicon "shield-check" aria-hidden="true" %} **Generate fix**.
|
||||
1. Below the alert title, in the box suggesting you "Speed up the remediation of this alert using {% data variables.copilot.copilot_autofix_short %} for {% data variables.product.prodname_codeql %}", click {% octicon "shield-check" aria-hidden="true" %} **Generate fix**.
|
||||
1. After {% data variables.product.prodname_copilot_short %} generates the fix suggestion, it will describe the changes it is suggesting, render a preview of the changes, and call out any added dependencies. Take a moment to read through {% data variables.product.prodname_copilot_short %}'s work.
|
||||
1. To create a pull request with the fix, click **Commit to new branch**, then click **Commit change**.
|
||||
1. Once the draft pull request is created, at the bottom of the page, click **Ready for review** to make it mergeable.
|
||||
|
||||
@@ -17,7 +17,7 @@ Learning from projects on {% data variables.product.github %} is a great way of
|
||||
|
||||
However, with millions of publicly available repositories on {% data variables.product.github %}, finding code that applies to your project can be overwhelming. Even after you find the perfect repository, it can be difficult to navigate the codebase to find useful examples.
|
||||
|
||||
Instead of trying to understand an entire project, a better approach is to pick a single feature or function and see how it works. We can use {% data variables.product.prodname_copilot_chat_short %} and {% data variables.product.github %}'s search functionality to locate a feature and follow it through the codebase. This is a great way to learn as we can see how the feature works all the way from the backend to the frontend.
|
||||
Instead of trying to understand an entire project, a better approach is to pick a single feature or function and see how it works. We can use {% data variables.copilot.copilot_chat_short %} and {% data variables.product.github %}'s search functionality to locate a feature and follow it through the codebase. This is a great way to learn as we can see how the feature works all the way from the backend to the frontend.
|
||||
|
||||
In this guide, you'll learn how to do both by following an **example scenario**: learning how to load and display data from files on a Jekyll website. Then, you can apply the tips and techniques to other projects and programming languages.
|
||||
|
||||
@@ -25,11 +25,11 @@ In this guide, you'll learn how to do both by following an **example scenario**:
|
||||
|
||||
The first step is to find the right project to learn from.
|
||||
|
||||
### Use {% data variables.product.prodname_copilot_chat_short %} to identify a repository
|
||||
### Use {% data variables.copilot.copilot_chat_short %} to identify a repository
|
||||
|
||||
The fastest way to find a project with code that you can learn from is to ask [{% data variables.product.prodname_copilot_chat_short %}](https://github.com/copilot) to find repositories that match your criteria.
|
||||
The fastest way to find a project with code that you can learn from is to ask [{% data variables.copilot.copilot_chat_short %}](https://github.com/copilot) to find repositories that match your criteria.
|
||||
|
||||
Open [{% data variables.product.prodname_copilot_chat_short %}](https://github.com/copilot) and start a general purpose chat. Then ask:
|
||||
Open [{% data variables.copilot.copilot_chat_short %}](https://github.com/copilot) and start a general purpose chat. Then ask:
|
||||
|
||||
> Can you find some popular repositories that use Jekyll to display data from files in the repository?
|
||||
|
||||
@@ -67,11 +67,11 @@ It's always a good idea to read the **README.md** file, which is the front page
|
||||
|
||||
In the [`github/choosealicense.com`](https://github.com/github/choosealicense.com) repository, the README.md file explains where the license files live (`/_licenses`), the attributes each license can have, and how to get the website running on your computer.
|
||||
|
||||
### Using {% data variables.product.prodname_copilot_chat_short %}
|
||||
### Using {% data variables.copilot.copilot_chat_short %}
|
||||
|
||||
If the README.md file doesn't give you all the answers, you can ask {% data variables.product.prodname_copilot_short %} to help you navigate the repository and locate functionality.
|
||||
|
||||
To open {% data variables.product.prodname_copilot_chat_short %}, click the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** {% data variables.product.prodname_copilot %} icon next to the search bar and ask your question. For example:
|
||||
To open {% data variables.copilot.copilot_chat_short %}, click the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** {% data variables.product.prodname_copilot %} icon next to the search bar and ask your question. For example:
|
||||
|
||||
>What is the main landing page for this Jekyll website?
|
||||
|
||||
@@ -111,7 +111,7 @@ Now we can click on the result and dig deeper! [`licenses.html`](https://github.
|
||||
|
||||
Now that we've found the specific code we're interested in, we can move on to understanding it.
|
||||
|
||||
### Asking {% data variables.product.prodname_copilot_chat_short %} about the code
|
||||
### Asking {% data variables.copilot.copilot_chat_short %} about the code
|
||||
|
||||
You can use {% data variables.product.prodname_copilot_short %} to learn more about a file or even specific lines of code. {% data variables.product.prodname_copilot_short %} will combine information about the programming language with the context from the repository to answer your questions in great detail.
|
||||
|
||||
@@ -122,7 +122,7 @@ Let's ask {% data variables.product.prodname_copilot_short %} to explain what's
|
||||
{% data variables.product.prodname_copilot_short %} will explain that the line is including the `license-overview.html` file and passing along `"agpl-3.0"` as the `license-id` to display.
|
||||
|
||||
>[!TIP]
|
||||
>If you don't understand a response from {% data variables.product.prodname_copilot_chat_short %}, you can always ask it to simplify the answer or expand on a particular part of it.
|
||||
>If you don't understand a response from {% data variables.copilot.copilot_chat_short %}, you can always ask it to simplify the answer or expand on a particular part of it.
|
||||
|
||||
### Reading comments
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ Before you start working with the command line, you need to set up a few tools.
|
||||
```
|
||||
|
||||
Choose to authenticate with **{% data variables.product.prodname_dotcom_the_website %}**, then follow the on-screen prompts.
|
||||
1. Install {% data variables.product.prodname_copilot_cli %}, a powerful extension for the {% data variables.product.prodname_cli %} that helps you find and understand commands, by running the following command:
|
||||
1. Install {% data variables.copilot.copilot_cli %}, a powerful extension for the {% data variables.product.prodname_cli %} that helps you find and understand commands, by running the following command:
|
||||
|
||||
```shell copy
|
||||
gh extension install github/gh-copilot
|
||||
|
||||
@@ -69,7 +69,7 @@ Unfortunately, we get some error text in our terminal ending with the following
|
||||
|
||||
#### Debugging the file
|
||||
|
||||
To understand what this error means, [open {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode_shortname %}](vscode://GitHub.Copilot-Chat), then paste and send the following prompt: <!-- markdownlint-disable-line GHD003 -->
|
||||
To understand what this error means, [open {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode_shortname %}](vscode://GitHub.Copilot-Chat), then paste and send the following prompt: <!-- markdownlint-disable-line GHD003 -->
|
||||
|
||||
```text copy
|
||||
Explain in depth why my code produces the following error and how I can fix it:
|
||||
@@ -111,7 +111,7 @@ Unfortunately, the code isn't working as expected. We want it to return `720`, t
|
||||
|
||||
#### Debugging the file
|
||||
|
||||
To understand what went wrong, [open {% data variables.product.prodname_copilot_chat_short %}](vscode://GitHub.Copilot-Chat) and send the following prompt: <!-- markdownlint-disable-line GHD003 -->
|
||||
To understand what went wrong, [open {% data variables.copilot.copilot_chat_short %}](vscode://GitHub.Copilot-Chat) and send the following prompt: <!-- markdownlint-disable-line GHD003 -->
|
||||
|
||||
```text copy
|
||||
Why is the output of this code so much higher than expected? Please explain in depth and suggest a solution.
|
||||
@@ -139,4 +139,4 @@ With these tactics, you're well equipped to start squashing bugs in your project
|
||||
|
||||
## Next steps
|
||||
|
||||
As you continue coding, you'll likely encounter specific problem scenarios and errors that are difficult to debug. For a list of potential issues and example {% data variables.product.prodname_copilot_chat_short %} prompts to fix them, see [AUTOTITLE](/copilot/copilot-chat-cookbook/debugging-errors).
|
||||
As you continue coding, you'll likely encounter specific problem scenarios and errors that are difficult to debug. For a list of potential issues and example {% data variables.copilot.copilot_chat_short %} prompts to fix them, see [AUTOTITLE](/copilot/copilot-chat-cookbook/debugging-errors).
|
||||
|
||||
@@ -66,7 +66,7 @@ Now, you're ready to paste the code snippet into your project. While you'll some
|
||||
|
||||
Let's say we want to quickly calculate the factorials of 5, 7, 9, and 10. Instead of copying and pasting the entire program for each number, we can move our calculator into a **function** that takes a number as an argument.
|
||||
|
||||
Use [{% data variables.product.prodname_copilot_chat_short %}](https://github.com/copilot) to suggest and explain an implementation. Paste our current code into the chat window, followed by this prompt:
|
||||
Use [{% data variables.copilot.copilot_chat_short %}](https://github.com/copilot) to suggest and explain an implementation. Paste our current code into the chat window, followed by this prompt:
|
||||
|
||||
```text copy
|
||||
Wrap the Python code above in a function.
|
||||
@@ -122,9 +122,9 @@ print(calculate_factorial(10))
|
||||
|
||||
### 1. Finding a library
|
||||
|
||||
Once you know what functionality you want to add to your project, you can search for a library with relevant code. {% data variables.product.prodname_copilot_chat_short %} is an easy way to search for libraries, since you can use natural language to describe exactly what you're looking for.
|
||||
Once you know what functionality you want to add to your project, you can search for a library with relevant code. {% data variables.copilot.copilot_chat_short %} is an easy way to search for libraries, since you can use natural language to describe exactly what you're looking for.
|
||||
|
||||
Finding a factorial is a pretty common function, and there's a good chance someone included that function in an existing library. Open [{% data variables.product.prodname_copilot_chat_short %}](https://github.com/copilot), then ask:
|
||||
Finding a factorial is a pretty common function, and there's a good chance someone included that function in an existing library. Open [{% data variables.copilot.copilot_chat_short %}](https://github.com/copilot), then ask:
|
||||
|
||||
```text copy
|
||||
Is there a Python library with a function for calculating a factorial?
|
||||
@@ -142,7 +142,7 @@ Thankfully, there are some steps you can take to best protect your project. Let'
|
||||
|
||||
Popular libraries are more likely to be secure, because they are actively maintained and used by many developers. One good marker of popularity is the number of **stars** a repository has. If you can't find the {% data variables.product.github %} repository for a dependency, you can ask {% data variables.product.prodname_copilot_short %} for help.
|
||||
|
||||
Open [{% data variables.product.prodname_copilot_chat_short %}](https://github.com/copilot), then ask:
|
||||
Open [{% data variables.copilot.copilot_chat_short %}](https://github.com/copilot), then ask:
|
||||
|
||||
```text copy
|
||||
Find the GitHub repository containing the code for the math module in Python.
|
||||
@@ -162,7 +162,7 @@ Turn {% data variables.product.prodname_dependabot_alerts %} on for your reposit
|
||||
|
||||
Now you're ready to import the library into your project, then use its contents in your code. You can read the documentation for the library to learn how to do it yourself, or you can ask {% data variables.product.prodname_copilot_short %} to suggest and explain an implementation for you.
|
||||
|
||||
Open [{% data variables.product.prodname_copilot_chat_short %}](https://github.com/copilot), then ask:
|
||||
Open [{% data variables.copilot.copilot_chat_short %}](https://github.com/copilot), then ask:
|
||||
|
||||
```text copy
|
||||
How do I use the factorial function of the math module in my Python project?
|
||||
|
||||
@@ -39,7 +39,7 @@ First, let's disable code completion. This will give you the opportunity to deep
|
||||
|
||||
## Step 2: Add learning instructions
|
||||
|
||||
Now, let's provide {% data variables.product.prodname_copilot_chat_short %} with instructions to act like a tutor that supports your learning.
|
||||
Now, let's provide {% data variables.copilot.copilot_chat_short %} with instructions to act like a tutor that supports your learning.
|
||||
|
||||
1. In the root folder of your project, create a file called `copilot-instructions.md`.
|
||||
1. Add the following text, or customize it for your personal learning goals:
|
||||
@@ -54,16 +54,16 @@ Now, let's provide {% data variables.product.prodname_copilot_chat_short %} with
|
||||
At the end of every response, add "Always check the correctness of AI-generated responses."
|
||||
```
|
||||
|
||||
1. Save the file. {% data variables.product.prodname_copilot_short %} will use these instructions when you ask questions in {% data variables.product.prodname_copilot_chat_short %}.
|
||||
1. Save the file. {% data variables.product.prodname_copilot_short %} will use these instructions when you ask questions in {% data variables.copilot.copilot_chat_short %}.
|
||||
|
||||
## Step 3: Use {% data variables.product.prodname_copilot_chat_short %} to learn
|
||||
## Step 3: Use {% data variables.copilot.copilot_chat_short %} to learn
|
||||
|
||||
You're ready to start building real coding skills with {% data variables.product.prodname_copilot_short %}'s help!
|
||||
|
||||
Throughout your work on the project, engage in a long-running conversation with **{% data variables.product.prodname_copilot_chat_short %}**. Treat it as your **personal tutor**, asking questions as they arise and using it to navigate challenges or clarify concepts.
|
||||
Throughout your work on the project, engage in a long-running conversation with **{% data variables.copilot.copilot_chat_short %}**. Treat it as your **personal tutor**, asking questions as they arise and using it to navigate challenges or clarify concepts.
|
||||
|
||||
<a href="vscode://GitHub.Copilot-Chat" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline" aria-label="Open Copilot Chat in Visual Studio Code">
|
||||
<span>Open {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode_shortname %}</span> {% octicon "link-external" height:16 aria-label="link-external" %}
|
||||
<span>Open {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode_shortname %}</span> {% octicon "link-external" height:16 aria-label="link-external" %}
|
||||
</a><br></br>
|
||||
|
||||
{% data variables.product.prodname_copilot_chat_short %} is especially helpful for debugging your code. For step-by-step guidance, see [AUTOTITLE](/get-started/learning-to-code/learning-to-debug-with-github-copilot).
|
||||
{% data variables.copilot.copilot_chat_short %} is especially helpful for debugging your code. For step-by-step guidance, see [AUTOTITLE](/get-started/learning-to-code/learning-to-debug-with-github-copilot).
|
||||
|
||||
Reference in New Issue
Block a user