1
0
mirror of synced 2025-12-22 03:16:52 -05:00

Codespaces: recommended secrets / one-click experience (#35684)

Co-authored-by: Isaac Brown <101839405+isaacmbrown@users.noreply.github.com>
Co-authored-by: isaacmbrown <isaacmbrown@github.com>
This commit is contained in:
hubwriter
2023-04-24 16:51:07 +01:00
committed by GitHub
parent 64b56a9a7c
commit 063e93a689
20 changed files with 242 additions and 70 deletions

View File

@@ -82,9 +82,9 @@ If you want to use Git hooks for your codespace, then you should set up hooks us
* **Use the default options**
To create a codespace using the default options, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}). Alternatively, if you don't currently have any codespaces for this repository, you can click **Create codespace on BRANCH**.
To create a codespace using the default options, click the plus sign ({% octicon "plus" aria-label="The plus icon" %}). Alternatively, if you don't currently have any codespaces for this repository, you can click **Create codespace on BRANCH**. <br/><br/>
* **Configure options**
* **Configure advanced options**
To configure advanced options for your codespace, such as a different machine type or a particular `devcontainer.json` file:
@@ -96,13 +96,15 @@ If you want to use Git hooks for your codespace, then you should set up hooks us
![Screenshot of the advanced options page with buttons for "Branch," "Dev container configuration," "Region," and "Machine type."](/assets/images/help/codespaces/advanced-options.png)
The options page may also display the names of one or more secrets that it's recommended you create in your {% data variables.product.prodname_codespaces %} settings. For more information, see "[Recommended secrets](#recommended-secrets)."
{% note %}
**Notes**
* You can bookmark the options page to give you a quick way to create a codespace for this repository and branch.
* The [https://github.com/codespaces/new](https://github.com/codespaces/new) page provides a quick way to create a codespace for any repository and branch. You can get to this page quickly by typing `codespace.new` into your browser's address bar.
* For more information about the `devcontainer.json` file, see "[AUTOTITLE](/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers#devcontainerjson)."
* For more information about dev container configuration files, see "[AUTOTITLE](/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers)."
* For more information about machine types, see "[AUTOTITLE](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)."
* {% data reusables.codespaces.codespaces-machine-type-availability %}
@@ -110,6 +112,20 @@ If you want to use Git hooks for your codespace, then you should set up hooks us
1. Click **Create codespace**.
## Recommended secrets
The names of user-defined secrets may be displayed on the advanced options page when you create a codespace. This will happen if recommended secrets have been specified in the dev container configuration you have selected.
<img src="/assets/images/help/codespaces/recommended-secrets.png" style="max-height:50rem" alt='Screenshot of the "Create codespace" page with four recommended secrets highlighted with a dark orange outline.' />
Entering values for these secrets, when you're prompted to do so, is recommended because it's likely your project will need values for these secrets. However, supplying values is not required for you to create a codespace. You can set these secrets within the codespace if you prefer.
If you enter a value for a recommended secret, the secret will available in the new codespace. When you click **Create codespace**, the secret is also added to your personal settings for {% data variables.product.prodname_codespaces %}, so you will not need to enter a value for the secret in future when you create a codespace for this repository.
If the name of a secret is shown with a checkbox that is unavailable for selection, and no input box, this is because you already have a secret of this name configured in your personal settings for {% data variables.product.prodname_codespaces %}, and you have associated it with this repository. If you've created a secret of this name but have not associated it with this repository, the checkbox will be available to select and by doing so you can update your settings to add the association.
If you want to change the value of a preselected secret you can do so from your personal settings for {% data variables.product.prodname_codespaces %} at [github.com/settings/codespaces](https://github.com/settings/codespaces). For more information, see "[AUTOTITLE](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)."
{% endwebui %}
{% vscode %}
@@ -148,4 +164,4 @@ For full details of the options for this command, see [the {% data variables.pro
## Further reading
- "[AUTOTITLE](/codespaces/developing-in-codespaces/opening-an-existing-codespace)"
- "[AUTOTITLE](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-repository/adding-a-codespaces-badge)"
- "[AUTOTITLE](/codespaces/setting-up-your-project-for-codespaces/setting-up-your-repository/facilitating-quick-creation-and-resumption-of-codespaces)"

View File

@@ -28,10 +28,32 @@ You can view all your codespaces on the "Your codespaces" page at [github.com/co
- Create a new codespace, either by choosing one of {% data variables.product.company_short %}'s templates or by clicking **New codespace**. For more information, see "[AUTOTITLE](/codespaces/developing-in-codespaces/creating-a-codespace-from-a-template)" and "[AUTOTITLE](/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository)."
- Prevent automatic deletion of a codespace. For more information, see "[AUTOTITLE](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces?tool=webui#avoiding-automatic-deletion-of-codespaces)."
## Reopening a codespace
{% webui %}
## Resuming a codespace from a repository page
You can quickly resume a codespace when you're viewing a repository on {% data variables.product.prodname_dotcom_the_website %}.
1. With the repository displayed on {% data variables.product.prodname_dotcom_the_website %}, press <kbd>,</kbd>.
The "Resume codespace" page is displayed. This allows you to resume your most recently used codespace for the currently selected branch of the repository or, if you were viewing a pull request, for the topic branch of the pull request.
![Screenshot of the "Resume codespace" page showing the "Resume this codespace" and "Create a new one" buttons.](/assets/images/help/codespaces/resume-codespace.png)
1. Click **Resume this codespace**.
Alternatively, if you want to create a new codespace for this branch of the repository, click **Create a new one**.
{% note %}
**Note**: If you don't have an existing codespace for this branch, the page is titled "Create codespace" and a button labeled **Create a new codespace** is displayed.
{% endnote %}
You can bookmark the address of this page if you want to get back to it quickly to resume your codespace. Alternatively you can use the address in a link to provide other people with a quick way of creating and resuming their own codespaces for this repository.
## Opening an existing codespace from the "Your codespaces" page
{% data reusables.codespaces.your-codespaces-procedure-step %}
1. To open a codespace in your default editor, click the name of the codespace. {% data reusables.codespaces.about-changing-default-editor %} For more information, see "[AUTOTITLE](/codespaces/customizing-your-codespace/setting-your-default-editor-for-github-codespaces)."
@@ -57,6 +79,8 @@ You can view all your codespaces on the "Your codespaces" page at [github.com/co
{% vscode %}
## Reopening an existing codespace
{% note %}
**Note:** {% data reusables.codespaces.using-codespaces-in-vscode %} For more information, see "[AUTOTITLE](/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code)."
@@ -80,6 +104,8 @@ You can also access the commands listed above by navigating to the Remote Explor
{% cli %}
## Reopening an existing codespace
1. In a terminal, enter one of the following {% data variables.product.prodname_cli %} commands.
- To open a codespace in {% data variables.product.prodname_vscode_shortname %}, enter:
@@ -126,6 +152,8 @@ For more information, see [`gh codespace code`](https://cli.github.com/manual/gh
{% jetbrains %}
## Reopening an existing codespace
{% data reusables.codespaces.opening-codespace-in-jetbrains %}
{% endjetbrains %}