1
0
mirror of synced 2025-12-25 02:17:36 -05:00

Merge branch 'main' into sponsors-react-3

This commit is contained in:
Mike Surowiec
2021-05-11 13:41:15 -07:00
committed by GitHub
200 changed files with 2257 additions and 548 deletions

View File

@@ -0,0 +1,33 @@
---
name: Batch Status Update
description: Batch Status Update
body:
- type: dropdown
attributes:
label: Status
options:
- label: "GREEN \U0001F7E2 (All good, smooth sailing)"
value: 'Status: GREEN'
- label:
"YELLOW \U0001F7E1 (We've identified areas of concern, but have them under
control at this time)"
value: 'Status: YELLOW'
- label: "RED \U0001F534 (We need help, there are blockers beyond our control)"
value: 'Status: RED'
- label: GREY ⚪️ (Not started, paused, not currently being worked on)
value: 'Status: GREY'
- label: "BLACK ⚫️ (We shipped it \U0001F389)"
value: 'Status: BLACK'
- type: input
attributes:
label: Target date
format: date
- type: textarea
attributes:
label: Update
placeholder: A few words on how it's going
- type: input
attributes:
label: 'Attribution'
value: '_created with :heart: by typing_ `/status`'
format: text

View File

@@ -1,29 +0,0 @@
---
name: A brief status update
description: A brief status update.
body:
- type: dropdown
attributes:
label: Status
options:
- label: 'GREY ⚪️ (Not started, paused, not currently being worked on)'
value: 'Status: GREY'
- label: 'GREEN 🟢 (All good, smooth sailing)'
value: 'Status: GREEN'
- label: "YELLOW \U0001F7E1 (On track, with hurdles to work through)"
value: 'Status: YELLOW'
- label: "RED \U0001F534 (BLOCKED)"
value: 'Status: RED'
- label: "BLACK ⚫️ (We shipped it \U0001F389)"
value: 'Status: BLACK'
- type: textarea
attributes:
label: Update Summary
placeholder:
Brief summary of the status and next steps. Any blockers should be
called out specifically.
- type: input
attributes:
label: 'Attribution'
value: '_created with :heart: by typing_ `/status`'
format: text

View File

@@ -12,19 +12,20 @@ Thanks again!
### Why:
Closes [issue link]
<!--
- If there's an existing issue for your change, please link to it.
- If there's _not_ an existing issue, please open one first to make it more likely that this update will be accepted: https://github.com/github/docs/issues/new/choose. -->
**Closes [issue link]**
### What's being changed:
<!-- Share artifacts of the changes, be they code snippets, GIFs or screenshots; whatever shares the most context. -->
### Check off the following:
- [ ] I have reviewed my changes in staging. (look for the **deploy-to-heroku** link in your pull request, then click **View deployment**)
- [ ] For content changes, I have reviewed the [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md)
- [ ] For content changes, I have reviewed the [Content style guide for GitHub Docs](https://github.com/github/docs/blob/main/contributing/content-style-guide.md).
- [ ] I have reviewed my changes in staging (look for the **deploy-to-heroku** link in your pull request, then click **View deployment**).
- [ ] For content changes, I have completed the [self-review checklist](https://github.com/github/docs/blob/main/CONTRIBUTING.md#self-review).
### Writer impact (This section is for GitHub staff members only):

View File

@@ -0,0 +1,232 @@
# TODO: Convert to JavaScript for language consistency
import json
import logging
import os
import requests
# Constants
endpoint = 'https://api.github.com/graphql'
# ID of the github/github repo
github_repo_id = "MDEwOlJlcG9zaXRvcnkz"
# ID of the docs-reviewers team
docs_reviewers_id = "MDQ6VGVhbTQzMDMxMzk="
# ID of the "Docs content first responder" board
docs_project_id = "MDc6UHJvamVjdDQ1NzI0ODI="
# ID of the "OpenAPI review requests" column on the "Docs content first responder" board
docs_column_id = "PC_lAPNJr_OAEXFQs4A2OFq"
# 100 is an educated guess of how many PRs are opened in a day on the github/github repo
# If we are missing PRs, either increase this number or increase the frequency at which this script is run
num_prs_to_search = 100
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def find_open_prs_for_repo(repo_id: str, num_prs: int):
"""Return data about a specified number of open PRs for a specified repo
Arguments:
repo_id: The node ID of the repo to search
num_prs: The max number of PRs to return
Returns:
Returns a JSON object of this structure:
{
"data": {
"node": {
"pullRequests": {
"nodes": [
{
"id": str,
"isDraft": bool,
"reviewRequests": {
"nodes": [
{
"requestedReviewer": {
"id": str
}
}...
]
},
"projectCards": {
"nodes": [
{
"project": {
"id": str
}
}...
]
}
}...
]
}
}
}
}
"""
query = """query ($repo_id: ID!, $num_prs: Int!) {
node(id: $repo_id) {
... on Repository {
pullRequests(last: $num_prs, states: OPEN) {
nodes {
id
isDraft
reviewRequests(first: 10) {
nodes {
requestedReviewer {
... on Team {
id
}
}
}
}
projectCards(first: 10) {
nodes {
project {
id
}
}
}
}
}
}
}
}
"""
variables = {
"repo_id": github_repo_id,
"num_prs": num_prs
}
response = requests.post(
endpoint,
json={'query': query, 'variables': variables},
headers = {'Authorization': f"bearer {os.environ['TOKEN']}"}
)
response.raise_for_status()
json_response = json.loads(response.text)
if 'errors' in json_response:
raise RuntimeError(f'Error in GraphQL response: {json_response}')
return json_response
def add_prs_to_board(prs_to_add: list, column_id: str):
"""Adds PRs to a column of a project board
Arguments:
prs_to_add: A list of PR node IDs
column_id: The node ID of the column to add the PRs to
Returns:
Nothing
"""
logger.info(f"adding: {prs_to_add}")
mutation = """mutation($pr_id: ID!, $column_id: ID!) {
addProjectCard(input:{contentId: $pr_id, projectColumnId: $column_id}) {
projectColumn {
name
}
}
}"""
for pr_id in prs_to_add:
logger.info(f"Attempting to add {pr_id} to board")
variables = {
"pr_id": pr_id,
"column_id": column_id
}
response = requests.post(
endpoint,
json={'query': mutation, 'variables': variables},
headers = {'Authorization': f"bearer {os.environ['TOKEN']}"}
)
json_response = json.loads(response.text)
if 'errors' in json_response:
logger.info(f"GraphQL error when adding {pr_id}: {json_response}")
def filter_prs(data, reviewer_id: str, project_id):
"""Given data about the draft state, reviewers, and project boards for PRs,
return just the PRs that are:
- not draft
- are requesting a review for the specified team
- are not already on the specified project board
Arguments:
data: A JSON object of this structure:
{
"data": {
"node": {
"pullRequests": {
"nodes": [
{
"id": str,
"isDraft": bool,
"reviewRequests": {
"nodes": [
{
"requestedReviewer": {
"id": str
}
}...
]
},
"projectCards": {
"nodes": [
{
"project": {
"id": str
}
}...
]
}
}...
]
}
}
}
}
reviewer_id: The node ID of the reviewer to filter for
project_id: The project ID of the project to filter against
Returns:
A list of node IDs of the PRs that met the requirements
"""
pr_data = data['data']['node']['pullRequests']['nodes']
prs_to_add = []
for pr in pr_data:
if (
not pr['isDraft'] and
reviewer_id in [req_rev['requestedReviewer']['id'] for req_rev in pr['reviewRequests']['nodes'] if req_rev['requestedReviewer']] and
project_id not in [proj_card['project']['id'] for proj_card in pr['projectCards']['nodes']]
):
prs_to_add.append(pr['id'])
return prs_to_add
def main():
query_data = find_open_prs_for_repo(github_repo_id, num_prs_to_search)
prs_to_add = filter_prs(query_data, docs_reviewers_id, docs_project_id)
add_prs_to_board(prs_to_add, docs_column_id)
if __name__ == "__main__":
main()

View File

@@ -9,6 +9,7 @@ module.exports = [
"actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9", // v3.0.0
"actions/labeler@5f867a63be70efff62b767459b009290364495eb", // v2.2.0
"actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e", // v2.1.4
"actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6", // v2.2.2
"ruby/setup-ruby@fdcfbcf14ec9672f6f615cb9589a1bc5dd69d262", // v1.64.1
"actions/stale@9d6f46564a515a9ea11e7762ab3957ee58ca50da", // v3.0.16
"alex-page/github-project-automation-plus@fdb7991b72040d611e1123d2b75ff10eda9372c9",

34
.github/review-template.md vendored Normal file
View File

@@ -0,0 +1,34 @@
## Author self-review
- [ ] The changes in this PR meet the user experience and goals outlined in the content design plan.
- [ ] I've compared my PR's source changes to staging and reviewed for versioning issues, redirects, the [style guide](https://github.com/github/docs/blob/main/contributing/content-style-guide.md), [content model](https://github.com/github/docs-content-strategy/blob/main/content-design/models.md), or [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md) rendering problems, typos, and wonky screenshots.
- [ ] I've worked through build failures and tests are passing.
- [ ] For REST API content, I've verified that endpoints, parameters, and responses are correct and work as expected and provided curl samples below.
For more information, check out our [full review guidelines and checklist](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/reviews-and-feedback/review-process.md).
## Review request
### Summary
_Help reviewers understand this project and its context by writing a paragraph summarizing its goals and intended user experience and explaining how the PR meets those goals._
[Content design plan](LINK HERE)
### Docs Content review
_Give Docs Content any extra context, highlight areas for them to consider in their review, and ask them questions you need answered to ship the PR._
### Technical review
_Ping in technical reviewers, asking them to review whether content is technically accurate and right for the audience._
_Highlight areas for them to consider in their review and ask them questions you need answered to ship the PR._
### Content changes
[PR on staging](LINK HERE)
_Give a high-level overview of the changes in your PR and how they support the overall goals of the PR. Share links to important articles or changes in source and on staging. If your PR is large or complex, use a table to highlight changes with high user impact._
### Notes
_Discuss test failures, versioning issues, or anything else reviewers should know to consider the overall user experience of the PR._

View File

@@ -0,0 +1,36 @@
name: Add review template
# **What it does**: When a specific label is added to a PR, adds the contents of .github/review-template.md as a comment in the PR
# **Why we have it**: To help Docs Content team members ensure that their PR is ready for review
# **Who does it impact**: docs-internal maintainers and contributors
on:
pull_request:
types:
- labeled
jobs:
comment-that-approved:
name: Add review template
runs-on: ubuntu-latest
if: github.event.label.name == 'docs-content-ready-for-review' && github.repository == 'github/docs-internal'
steps:
- name: check out repo content
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
# Jump through some hoops to work with a multi-line file
- name: Store review template in variable
run: |
TEMPLATE=$(cat .github/workflows/review-template.md)
echo "TEMPLATE<<EOF" >> $GITHUB_ENV
echo "$TEMPLATE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment on the PR
run: |
gh pr comment $PR --body "$TEMPLATE"
env:
GITHUB_TOKEN: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
PR: ${{ github.event.pull_request.html_url }}
TEMPLATE: ${{ env.TEMPLATE }}

View File

@@ -0,0 +1,35 @@
name: Add docs-reviewers request to FR board
# **What it does**: Adds PRs in github/github that requested a review from docs-reviewers to the FR board
# **Why we have it**: To catch docs-reviewers requests in github/github
# **Who does it impact**: docs-content maintainers
on:
workflow_dispatch:
schedule:
- cron: '25 4 * * *'
jobs:
add-requests-to-board:
name: Add requests to board
runs-on: ubuntu-latest
steps:
- name: Check out repo content
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Set up Python 3.9
uses: actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run script
run: |
python .github/actions-scripts/fr-add-docs-reviewers-requests.py
env:
TOKEN: ${{ secrets.DOCS_BOT }}

View File

@@ -158,12 +158,12 @@ We (usually the docs team, but sometimes GitHub product managers, engineers, or
You should always review your own PR first.
For content changes, make sure that you:
- [ ] Confirm that the changes address every part of the content design plan from your issue (if there are differences, explain them).
- [ ] Confirm that the changes meet the user experience and goals outlined in the content design plan (if there is one).
- [ ] Compare your pull request's source changes to staging to confirm that the output matches the source and that everything is rendering as expected. This helps spot issues like typos, content that doesn't follow the style guide, or content that isn't rendering due to versioning problems. Remember that lists and tables can be tricky.
- [ ] Review the content for technical accuracy.
- [ ] Review the entire pull request using the [localization checklist](contributing/localization-checklist.md).
- [ ] Copy-edit the changes for grammar, spelling, and adherence to the style guide.
- [ ] Copy-edit the changes for grammar, spelling, and adherence to the [style guide](https://github.com/github/docs/blob/main/contributing/content-style-guide.md).
- [ ] Check new or updated Liquid statements to confirm that versioning is correct.
- [ ] Check that all of your changes render correctly in staging. Remember, that lists and tables can be tricky.
- [ ] If there are any failing checks in your PR, troubleshoot them until they're all passing.
### Pull request template

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 KiB

After

Width:  |  Height:  |  Size: 407 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -57,7 +57,7 @@ See [Versioning](#versioning) for more info.
Example that applies to GitHub.com and recent versions of GitHub Enterprise Server:
```yml
```yaml
title: About your personal dashboard
versions:
free-pro-team: '*'
@@ -67,7 +67,7 @@ versions:
Example that applies to all supported versions of GitHub Enterprise Server:
(but not GitHub.com):
```yml
```yaml
title: Downloading your license
versions:
enterprise-server: '*'
@@ -75,7 +75,7 @@ versions:
You can also version a page for a range of releases. This would version the page for GitHub Enterprise Server 2.22 and 3.0 only:
```yml
```yaml
versions:
free-pro-team: '*'
enterprise-server: '>=2.22 <3.1'
@@ -89,7 +89,7 @@ versions:
Example:
```yml
```yaml
title: Getting started with GitHub Desktop
redirect_from:
- /articles/first-launch/
@@ -113,7 +113,7 @@ See [`contributing/redirects`](contributing/redirects.md) for more info.
Example:
```yml
```yaml
title: Contributing to projects with GitHub Desktop
shortTitle: Contributing to projects
```
@@ -233,7 +233,7 @@ defaultTool: cli
Example:
```yml
```yaml
includeGuides:
- /actions/guides/about-continuous-integration
- /actions/guides/setting-up-continuous-integration-using-workflow-templates
@@ -258,7 +258,7 @@ includeGuides:
Example:
```yml
```yaml
contributor:
name: ACME, inc.
URL: https://acme.example.com/

View File

@@ -172,7 +172,7 @@ In this example, `cleanup.js` only runs on Linux-based runners:
```yaml
pre: 'cleanup.js'
pre-if: 'runner.os == linux'
pre-if: runner.os == 'linux'
```
#### `post`
@@ -198,7 +198,7 @@ For example, this `cleanup.js` will only run on Linux-based runners:
```yaml
post: 'cleanup.js'
post-if: 'runner.os == linux'
post-if: runner.os == 'linux'
```
### `runs` for composite run steps actions

View File

@@ -48,6 +48,7 @@ In addition to helping you set up CI workflows for your project, you can use {%
For a definition of common terms, see "[Core concepts for {% data variables.product.prodname_actions %}](/github/automating-your-workflow-with-github-actions/core-concepts-for-github-actions)."
### Supported languages
<!-- If you make changes to this feature, update /getting-started-with-github/github-language-support to reflect any changes to supported languages. -->
{% data variables.product.product_name %} offers CI workflow templates for a variety of languages and frameworks.

View File

@@ -59,7 +59,16 @@ For more information, see [`actions/cache`](https://github.com/actions/cache).
- `key`: **Required** The key created when saving a cache and the key used to search for a cache. Can be any combination of variables, context values, static strings, and functions. Keys have a maximum length of 512 characters, and keys longer than the maximum length will cause the action to fail.
- `path`: **Required** The file path on the runner to cache or restore. The path can be an absolute path or relative to the working directory.
- With `v2` of the `cache` action, you can specify a single path, or multiple paths as a list. Paths can be either directories or single files, and glob patterns are supported.
- Paths can be either directories or single files, and glob patterns are supported.
- With `v2` of the `cache` action, you can specify a single path, or you can add multiple paths on separate lines. For example:
```
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
```
- With `v1` of the `cache` action, only a single path is supported and it must be a directory. You cannot cache a single file.
- `restore-keys`: **Optional** An ordered list of alternative keys to use for finding the cache if no cache hit occurred for `key`.

View File

@@ -66,7 +66,7 @@ To remove a self-hosted runner from an organization, you must be an organization
{% if currentVersion == "free-pro-team@latest" %}
To remove a self-hosted runner from an enterprise account, you must be an enterprise owner. We recommend that you also have access to the self-hosted runner machine.
{% elsif enterpriseServerVersions contains currentVersion and currentVersion ver_gt "enterprise-server@2.21"% or currentVersion == "github-ae@latest" }
{% elsif enterpriseServerVersions contains currentVersion and currentVersion ver_gt "enterprise-server@2.21" or currentVersion == "github-ae@latest" %}
To remove a self-hosted runner at the enterprise level of {% data variables.product.product_location %}, you must be a site administrator. We recommend that you also have access to the self-hosted runner machine.
{% endif %}

View File

@@ -104,7 +104,7 @@ This list describes the recommended approaches for accessing repository data wit
**Self-hosted** runners on {% data variables.product.product_name %} do not have guarantees around running in ephemeral clean virtual machines, and can be persistently compromised by untrusted code in a workflow.
As a result, self-hosted runners should almost [never be used for public repositories](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories) on {% data variables.product.product_name %}, because any user can open pull requests against the repository and compromise the environment. Similarly, be cautious when using self-hosted runners on private repositories, as anyone who can fork the repository and open a pull request (generally those with read-access to the repository) are able to compromise the self-hosted runner environment, including gaining access to secrets and the `GITHUB_TOKEN` which{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}, depending on its settings, can grant {% else %} grants {% endif %}write-access permissions on the repository.
As a result, self-hosted runners should almost [never be used for public repositories](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories) on {% data variables.product.product_name %}, because any user can open pull requests against the repository and compromise the environment. Similarly, be cautious when using self-hosted runners on private repositories, as anyone who can fork the repository and open a pull request (generally those with read-access to the repository) are able to compromise the self-hosted runner environment, including gaining access to secrets and the `GITHUB_TOKEN` which{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}, depending on its settings, can grant {% else %} grants {% endif %}write-access permissions on the repository. Although workflows can control access to environment secrets by using environments and required reviews, these workflows are not run in an isolated environment and are still susceptible to the same risks when run on a self-hosted runner.
When a self-hosted runner is defined at the organization or enterprise level, {% data variables.product.product_name %} can schedule workflows from multiple repositories onto the same runner. Consequently, a security compromise of these environments can result in a wide impact. To help reduce the scope of a compromise, you can create boundaries by organizing your self-hosted runners into separate groups. For more information, see "[Managing access to self-hosted runners using groups](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups)."

View File

@@ -60,7 +60,7 @@ Contexts are a way to access information about workflow runs, runner environment
| Context name | Type | Description |
|---------------|------|-------------|
| `github` | `object` | Information about the workflow run. For more information, see [`github` context](#github-context). |
| `env` | `object` | Contains environment variables set in a workflow, job, or step. For more information, see [`env` context](#env-context) . |
| `env` | `object` | Contains environment variables set in a workflow, job, or step. For more information, see [`env` context](#env-context). |
| `job` | `object` | Information about the currently executing job. For more information, see [`job` context](#job-context). |
| `steps` | `object` | Information about the steps that have been run in this job. For more information, see [`steps` context](#steps-context). |
| `runner` | `object` | Information about the runner that is running the current job. For more information, see [`runner` context](#runner-context). |
@@ -93,11 +93,11 @@ The `github` context contains information about the workflow run and the event t
| `github.action` | `string` | The name of the action currently running. {% data variables.product.prodname_dotcom %} removes special characters or uses the name `run` when the current step runs a script. If you use the same action more than once in the same job, the name will include a suffix with the sequence number. For example, the first script you run will have the name `run1`, and the second script will be named `run2`. Similarly, the second invocation of `actions/checkout` will be `actionscheckout2`. |
| `github.action_path` | `string` | The path where your action is located. You can use this path to easily access files located in the same repository as your action. This attribute is only supported in composite run steps actions. |
| `github.actor` | `string` | The login of the user that initiated the workflow run. |
| `github.base_ref` | `string` | The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is a `pull_request`. |
| `github.base_ref` | `string` | The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. |
| `github.event` | `object` | The full event webhook payload. For more information, see "[Events that trigger workflows](/articles/events-that-trigger-workflows/)." You can access individual properties of the event using this context. |
| `github.event_name` | `string` | The name of the event that triggered the workflow run. |
| `github.event_path` | `string` | The path to the full event webhook payload on the runner. |
| `github.head_ref` | `string` | The `head_ref` or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is a `pull_request`. |
| `github.head_ref` | `string` | The `head_ref` or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. |
| `github.job` | `string` | The [`job_id`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) of the current job. |
| `github.ref` | `string` | The branch or tag ref that triggered the workflow run. For branches this in the format `refs/heads/<branch_name>`, and for tags it is `refs/tags/<tag_name>`. |
| `github.repository` | `string` | The owner and repository name. For example, `Codertocat/Hello-World`. |

View File

@@ -29,15 +29,9 @@ For secrets stored at the environment level, you can enable required reviewers t
#### Naming your secrets
The following rules apply to secret names:
* Secret names can only contain alphanumeric characters (`[a-z]`, `[A-Z]`, `[0-9]`) or underscores (`_`). Spaces are not allowed.
* Secret names must not start with the `GITHUB_` prefix.
* Secret names must not start with a number.
* Secret names are not case-sensitive.
* Secret names must be unique at the level they are created at. For example, {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}a secret created at the environment level must have a unique name in that environment, {% endif %}a secret created at the repository level must have a unique name in that repository, and a secret created at the organization level must have a unique name at that level.
{% data reusables.codespaces.secrets-naming %}. For example, {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}a secret created at the environment level must have a unique name in that environment, {% endif %}a secret created at the repository level must have a unique name in that repository, and a secret created at the organization level must have a unique name at that level.
If a secret with the same name exists at multiple levels, the secret at the lower level takes precedence. For example, if an organization-level secret has the same name as a repository-level secret, then the repository-level secret takes precedence.{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %} Similarly, if an organization, repository, and environment all have a secret with the same name, the environment-level secret takes precedence.{% endif %}
{% data reusables.codespaces.secret-precedence %}{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %} Similarly, if an organization, repository, and environment all have a secret with the same name, the environment-level secret takes precedence.{% endif %}
To help ensure that {% data variables.product.prodname_dotcom %} redacts your secret in logs, avoid using structured data as the values of secrets. For example, avoid creating secrets that contain JSON or encoded Git blobs.
@@ -83,7 +77,8 @@ If your repository {% if currentVersion == "free-pro-team@latest" or currentVers
{% endnote %}
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" }
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}
### Creating encrypted secrets for an environment
{% data reusables.github-actions.permissions-statement-secrets-environment %}

View File

@@ -48,6 +48,12 @@ Use deployment branches to restrict which branches can deploy to the environment
Secrets stored in an environment are only available to workflow jobs that reference the environment. If the environment requires approval, a job cannot access environment secrets until one of the required reviewers approves it. For more information about secrets, see "[Encrypted secrets](/actions/reference/encrypted-secrets)."
{% note %}
**Note:** Workflows that run on self-hosted runners are not run in an isolated container, even if they use environments. Environment secrets should be treated with the same level as security as repository and organization secrets. For more information, see "[Security hardening for GitHub Actions](/actions/learn-github-actions/security-hardening-for-github-actions#hardening-for-self-hosted-runners)."
{% endnote %}
### Creating an environment
{% data reusables.github-actions.permissions-statement-environment %}
@@ -83,7 +89,7 @@ Deleting an environment will delete all secrets and protection rules associated
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
{% data reusables.github-actions.sidebar-environment %}
1. Next the the environment that you want to delete, click {% octicon "trash" aria-label="The trash icon" %}.
1. Next to the environment that you want to delete, click {% octicon "trash" aria-label="The trash icon" %}.
2. Click **I understand, delete this environment**.
{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@next" or currentVersion ver_gt "enterprise-server@3.1" %}You can also delete environments through the REST API. For more information, see "[Environments](/rest/reference/repos#environments)."{% endif %}

View File

@@ -481,9 +481,15 @@ ghe-webhook-logs -f -a <em>YYYYMMDD</em>
{% endif %}
To show the full hook payload, result, and any exceptions for the delivery:
{% if currentVersion ver_gt "enterprise-server@2.22" %}
```shell
ghe-webhook-logs -g <em>delivery-guid</em>
```
{% else %}
```shell
ghe-webhook-logs -g <em>delivery-guid</em> -v
```
{% endif %}
### Clustering

View File

@@ -32,7 +32,7 @@ User | License dates | Counted days | Cost
@prodocat | January 7 - January 15 | 25 | $31.45
@monalisa | January 1 - January 7,<br>January 15 - January 31 | 31 | $39
Your enterprise can include one or more instances. {% data variables.product.prodname_ghe_managed %} has a 500-user minimum per instance. {% data variables.product.company_short %} bills you for a minimum of 500 users per instance, even if there are fewer than 500 users with a license that day.
{% data variables.product.prodname_ghe_managed %} has a 500-user minimum per instance. {% data variables.product.company_short %} bills you for a minimum of 500 users per instance, even if there are fewer than 500 users with a license that day.
You can see your current usage in your [Azure account portal](https://portal.azure.com).

View File

@@ -319,6 +319,7 @@ paths-ignore:
**Note**:
* The `paths` and `paths-ignore` keywords, used in the context of the {% data variables.product.prodname_code_scanning %} configuration file, should not be confused with the same keywords when used for `on.<push|pull_request>.paths` in a workflow. When they are used to modify `on.<push|pull_request>` in a workflow, they determine whether the actions will be run when someone modifies code in the specified directories. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpaths)."
* The filter pattern characters `?`, `+`, `[`, `]`, and `!` are not supported and will be matched literally.
* `**` characters can only be at the start or end of a line, or surrounded by slashes, and you can't mix `**` and other characters. For example, `foo/**`, `**/foo`, and `foo/**/bar` are all allowed syntax, but `**foo` isn't. However you can use single stars along with other characters, as shown in the example. You'll need to quote anything that contains a `*` character.
{% endnote %}

View File

@@ -201,7 +201,7 @@ For more information, see [github upload-results](https://codeql.github.com/docs
##### Basic example
```
$ echo $UPLOAD_TOKEN | codeql github upload --repository=my-org/example-repo \
$ echo $UPLOAD_TOKEN | codeql github upload-results --repository=my-org/example-repo \
--ref=refs/heads/main --commit=deb275d2d5fe9a522a0b7bd8b6b6a1c939552718 \
--sarif=/temp/example-repo-js.sarif {% if currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@next" %}--github-url={% data variables.command_line.git_url_example %} \
{% endif %}--github-auth-stdin

View File

@@ -91,7 +91,7 @@ This example workflow runs anytime commits are pushed to the repository. The act
The workflow shows an example of running the ESLint static analysis tool as a step in a workflow. The `Run ESLint` step runs the ESLint tool and outputs the `results.sarif` file. The workflow then uploads the `results.sarif` file to {% data variables.product.prodname_dotcom %} using the `upload-sarif` action. For more information about creating a workflow file, see "[Introduction to GitHub Actions](/actions/learn-github-actions/introduction-to-github-actions)."
```yml
```yaml
name: "ESLint analysis"
# Run workflow each time code is pushed to your repository and on a schedule.

View File

@@ -35,6 +35,7 @@ You specify how often to check each ecosystem for new versions in the configurat
If you've enabled security updates, you'll sometimes see extra pull requests for security updates. These are triggered by a {% data variables.product.prodname_dependabot %} alert for a dependency on your default branch. {% data variables.product.prodname_dependabot %} automatically raises a pull request to update the vulnerable dependency.
### Supported repositories and ecosystems
<!-- If you make changes to this feature, update /getting-started-with-github/github-language-support to reflect any changes to supported repositories or ecosystems. -->
You can configure version updates for repositories that contain a dependency manifest or lock file for one of the supported package managers. For some package managers, you can also configure vendoring for dependencies. For more information, see "[Configuration options for dependency updates](/github/administering-a-repository/configuration-options-for-dependency-updates#vendor)."

View File

@@ -474,11 +474,11 @@ To allow {% data variables.product.prodname_dependabot %} to access a private pa
To allow {% data variables.product.prodname_dependabot %} to use `bundler`, `mix`, and `pip` package managers to update dependencies in private registries, you can choose to allow external code execution. For more information, see [`insecure-external-code-execution`](#insecure-external-code-execution).
{% raw %}
```yaml
# Allow {% data variables.product.prodname_dependabot %} to use one of the two defined private registries
# when updating dependency versions for this ecosystem
{% raw %}
version: 2
registries:
maven-github:
@@ -497,8 +497,8 @@ updates:
- maven-github
schedule:
interval: "monthly"
```
{% endraw %}
```
#### `reviewers`

View File

@@ -17,7 +17,7 @@ You enable {% data variables.product.prodname_dependabot_version_updates %} by c
{% data reusables.dependabot.initial-updates %} For more information, see "[Customizing dependency updates](/github/administering-a-repository/customizing-dependency-updates)."
{% data reusables.dependabot.private-dependencies-note %} Additionally, {% data variables.product.prodname_dependabot %} doesn't support private {% data variables.product.prodname_dotcom %} dependencies for all package managers. For more information, see "[About Dependabot version updates](/github/administering-a-repository/about-dependabot-version-updates#supported-repositories-and-ecosystems)."
{% data reusables.dependabot.private-dependencies-note %} Additionally, {% data variables.product.prodname_dependabot %} doesn't support private {% data variables.product.prodname_dotcom %} dependencies for all package managers. For more information, see "[About Dependabot version updates](/github/administering-a-repository/about-dependabot-version-updates#supported-repositories-and-ecosystems)" and "[{% data variables.product.prodname_dotcom %} language support](/github/getting-started-with-github/github-language-support)."
### Enabling {% data variables.product.prodname_dependabot_version_updates %}

View File

@@ -0,0 +1,67 @@
---
title: About Codespaces
intro: '{% data variables.product.prodname_codespaces %} is a configurable online development environment, hosted by {% data variables.product.prodname_dotcom %} and powered by {% data variables.product.prodname_vscode %}, that allows you to develop entirely in the cloud.'
redirect_from:
- /github/developing-online-with-github-codespaces/about-github-codespaces
- /github/developing-online-with-codespaces/about-codespaces
- /codespaces/getting-started-with-codespaces/about-codespaces
versions:
free-pro-team: '*'
type: overview
topics:
- Codespaces
---
{% data reusables.codespaces.release-stage %}
### About {% data variables.product.prodname_codespaces %}
{% data variables.product.prodname_codespaces %} is a configurable cloud development environment available in your browser on {% data variables.product.prodname_dotcom %} or through {% data variables.product.prodname_vscode %}.
![An open codespace](/assets/images/help/codespaces/codespace-overview.png)
A codespace includes everything developers need to develop for a specific repository, including the {% data variables.product.prodname_vscode %} editing experience and common languages, tools, and utilities. {% data variables.product.prodname_codespaces %} is completely configurable, allowing you to create a customized development environment for your project, and allowing developers to personalize their experience with extensions and dotfile settings.
Codespaces offers many benefits to teams by allowing for a consistent environment across your entire team, fast onboarding, and creating a secure space for development.
### A consistent environment
You can create a single codespace configuration that defines the environment (or _dev container_) of every new codespace that anyone creates for your repository. Once you've made a configuration, developers dont have to worry about installing the right tools to comment, review, or contribute. A standardized environment is already available for them as soon as they create a codespace from the repository. For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project)."
For help getting started with configurations for specific languages, see the [Getting Started](/codespaces/getting-started-with-codespaces) tutorials.
While every codespace created from your repository has a consistent development environment, developers can use {% data variables.product.prodname_codespaces %} wherever they need it on {% data variables.product.prodname_dotcom %} or through {% data variables.product.prodname_vscode %}.
### Fast and personal onboarding
With a [dev container](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#about-dev-containers) configured in your repository, any new developer can quickly onboard with the correct development environment for your project by using the {% octicon "download" aria-label="The download icon" %} **Code** drop-down menu, and selecting **Open with Codespaces**.
![Open with Codespaces button](/assets/images/help/codespaces/open-with-codespaces-button.png)
As a result of standardizing on a repeatable developer environment, developers can get started with a new codespace without doing any manual configuration and do not need to do continued maintenance of their developer environment. A new codespace can be created when starting a new feature.
Developers can also personalize aspects of their codespace environment by using a [dotfiles](https://dotfiles.github.io/tutorials/) repository and [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync). Personalization can include shell preferences, additional tools, editor settings, and extensions, such as Live Share. Personal customizations are stored on a per-user basis, so every codespace a developer opens has their environment ready to go. For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/github/developing-online-with-codespaces/personalizing-codespaces-for-your-account)."
Because {% data variables.product.prodname_codespaces %} can be accessed in the browser, developers can work on multiple projects by switching between tabs.
### A secure environment
{% data variables.product.prodname_codespaces %} allows developers to develop in the cloud instead of locally. This creates one single, trackable, source of truth. Developers can contribute from anywhere, on any machine, including tablets or Chromebooks, and there is no need to maintain local copies of intellectual property. Developers always have to be logged in and provided with access to both {% data variables.product.prodname_codespaces %} and specific repositories. These permissions can be revoked at any time. As soon as you revoke access, those developers will lose all access to protected resources. In addition, authenticated developers create audit trails so you know who is doing what. For more information on access and security, see "[Managing access and security for your organization's codespaces](/codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces)."
Using {% data variables.product.prodname_codespaces %} is the most secure when all members of your team are using it. It means that there is no need to clone the repository onto a local machine and that developers don't need to install locally as `root`.
Developers and organization administrators can also configure settings to add encrypted secrets and enable GPG verification. For more information, see "[Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/managing-encrypted-secrets-for-codespaces)", "[Managing GPG verification for {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/managing-gpg-verification-for-codespaces)".
### About billing for {% data variables.product.prodname_codespaces %}
{% data reusables.codespaces.about-billing-for-codespaces %} For more information, see "[About billing for {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/about-billing-for-codespaces)."
### Joining the beta
A limited number of people will be invited to join the beta. To join the waitlist, see [Sign up for Codespaces beta](https://github.com/features/codespaces/signup).
### Contacting us about {% data variables.product.prodname_codespaces %}
If you encounter problems using {% data variables.product.prodname_codespaces %}, see "[Troubleshooting your codespace](/github/developing-online-with-codespaces/troubleshooting-your-codespace)."
If you still need help or have feedback about {% data variables.product.prodname_codespaces %}, use the [Codespaces Feedback](https://github.com/github/feedback/discussions/categories/codespaces-feedback) discussion.

View File

@@ -1,11 +1,12 @@
---
title: About billing for Codespaces
intro: 'When {% data variables.product.prodname_codespaces %} becomes generally available, you will be billed for storage and compute usage.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
free-pro-team: '*'
redirect_from:
- /github/developing-online-with-codespaces/about-billing-for-codespaces
- /codespaces/getting-started-with-codespaces/about-billing-for-codespaces
type: reference
topics:
- Codespaces
---

View File

@@ -0,0 +1,29 @@
---
title: Allowing your codespace to access a private image registry
intro: 'You can use secrets to allow {% data variables.product.prodname_codespaces %} to access a private image registry'
versions:
free-pro-team: '*'
topics:
- Codespaces
---
{% data reusables.codespaces.release-stage %}
A registry is a secure space for storing and managing private container images, such as Azure Container Registry or DockerHub. You can create secrets in GitHub to store the access details for a private registry and use them to give your codespace access to images stored in the registry.
When you launch a codespace, {% data variables.product.prodname_codespaces %} checks for three secrets, which define the server name, username, and personal access token (PAT) for a container registry. If these secrets are found, {% data variables.product.prodname_codespaces %} will make the registry available inside your codespace.
- `<*>_CONTAINER_REGISTRY_SERVER`
- `<*>_CONTAINER_REGISTRY_USER`
- `<*>_CONTAINER_REGISTRY_PASSWORD`
You can store secrets at the user, repository, or organization-level, allowing you to share them securely between different codespaces. When you create a set of secrets for a private image registry, you need to replace the “<*>” in the name with a consistent identifier. For more information, see "[Managing encrypted secrets for your codespaces](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)" and "[Managing encrypted secrets for your repository and organization for Codespaces](/codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces)."
For example, if you had a private image registry in Azure, you could create the following secrets:
```
ACR_CONTAINER_REGISTRY_SERVER = mycompany.azurecr.io
ACR_CONTAINER_REGISTRY_USER = acr-user-here
ACR_CONTAINER_REGISTRY_PASSWORD = <PAT>
```
![Image registry secret example](/assets/images/help/settings/codespaces-image-registry-secret-example.png)

View File

@@ -0,0 +1,14 @@
---
title: Reference
intro: 'This section contains references that will allow you to be successful with {% data variables.product.prodname_codespaces %}'
versions:
free-pro-team: '*'
---
{% data reusables.codespaces.release-stage %}
{% link_with_intro /about-billing-for-codespaces %}
{% link_with_intro /troubleshooting-your-codespace %}
{% link_with_intro /allowing-your-codespace-to-access-a-private-image-registry %}

View File

@@ -0,0 +1,68 @@
---
title: Troubleshooting your codespace
intro: Use this guide to help you troubleshoot common issues with your codespace.
redirect_from:
- /github/developing-online-with-github-codespaces/troubleshooting-your-codespace
- /github/developing-online-with-codespaces/troubleshooting-your-codespace
- /codespaces/working-with-your-codespace/troubleshooting-your-codespace
versions:
free-pro-team: '*'
type: reference
topics:
- Codespaces
---
{% data reusables.codespaces.release-stage %}
### Known Limitations
{% data reusables.codespaces.beta-functionality-limited %}
{% data reusables.codespaces.unsupported-repos %}
### {% data variables.product.prodname_vscode %} troubleshooting
Use **Issues** in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues) repository to check for known issues or to log issues about the {% data variables.product.prodname_vscode %} experience.
### Configuration troubleshooting
{% data reusables.codespaces.recovery-mode %}
```
This codespace is currently running in recovery mode due to a container error.
```
Review the creation logs, update the configuration as needed, and run **Codespaces: Rebuild Container** in the command palette to retry. For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#apply-changes-to-your-configuration)."
### dotfiles troubleshooting
- Make sure your dotfiles repository is public. If you have secrets or sensitive data you want to use in your codespace, use [Codespace secrets](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces) instead of private dotfiles.
- Check `/workspaces/.codespaces/.persistedshare/dotfiles` to see if your dotfiles were cloned.
- If your dotfiles were cloned, try manually re-running your install script to verify it's executable.
- If your dotfiles weren't cloned, check `/workspaces/.codespaces/.persistedshare/EnvironmentLog.txt` to see if there was a problem cloning them.
- Check `/workspaces/.codespaces/.persistedshare/creation.log` for possible issues. Alternatively, you can view the `creation.log` by navigating to the command palette and entering **Codespaces: View Creation Log**.
### Browser troubleshooting
If you encounter issues while using a browser that is not Chromium-based, try switching to a Chromium-based browser, or check for known issues with your browser in the `microsoft/vscode` repository by searching for issues labeled with the name of your browser, such as[`firefox`](https://github.com/microsoft/vscode/issues?q=is%3Aissue+is%3Aopen+label%3Afirefox) or [`safari`](https://github.com/Microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Asafari).
If you encounter issues while using a Chromium-based browser, you can check if you're experiencing another known issue with {% data variables.product.prodname_vscode %} in the [`microsoft/vscode`](https://github.com/microsoft/vscode/issues) repository.
### Container storage troubleshooting
When you create a codespace, it has a finite amount of storage and over time it may be necessary for you to free up space. Try any of the following items to free up storage space.
- Remove packages that are no longer by using `sudo apt autoremove`
- Clean the apt cache by using `sudo apt clean`
- Delete unneeded files like build artifacts and logs (these are very project-dependent)
- See the top 10 largest files in the codespace: `sudo find / -printf '%s %p\n'| sort -nr | head -10`
More destructive options:
- Remove unused Docker images, networks, and containers by using `docker system prune` (append `-a` if you want to remove all images, and `--volumes` if you want to remove all volumes)
- Remove untracked files from working tree: `git clean -i`
### Contact us
If you still need help, you can contact us. For more information, see "[About {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/about-codespaces#contacting-us-about-codespaces)."

View File

@@ -1,32 +1,42 @@
---
title: Creating a codespace
intro: You can create a codespace for a branch in a repository to develop online.
product: '{% data reusables.gated-features.codespaces %}'
permissions: 'Anyone can create a codespace for any public repository, or for any repository owned by their user account.'
redirect_from:
- /github/developing-online-with-github-codespaces/creating-a-codespace
- /github/developing-online-with-codespaces/creating-a-codespace
versions:
free-pro-team: '*'
type: how_to
topics:
- Codespaces
- Fundamentals
- Developer
---
{% data reusables.codespaces.release-stage %}
### About codespace creation
{% data reusables.codespaces.codespaces-are-personal %}
You can create a codespace on either {% data variables.product.prodname_dotcom_the_website %} or in {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.codespaces-are-personal %}
{% data reusables.codespaces.codespaces-are-per-branch %} {% data reusables.codespaces.concurrent-codespace-limit %} For more information, see "[Deleting a codespace](/github/developing-online-with-codespaces/deleting-a-codespace)."
Codespaces are associated with a specific branch of a repository and the repository cannot be empty. {% data reusables.codespaces.concurrent-codespace-limit %} For more information, see "[Deleting a codespace](/github/developing-online-with-codespaces/deleting-a-codespace)."
{% data reusables.codespaces.unsupported-repos %}
You cannot create a codespace in an empty repository. If your repository is empty, create a file in the repository before creating a codespace. For more information, see "[Adding a file to a repository](/github/managing-files-in-a-repository/adding-a-file-to-a-repository)" and "[Adding a file to a repository using the command line](/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line)."
When you create a codespace, a number of steps happen to enable full access to your development environment.
The environment of the codespace you create will be based on the repository's configuration. For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project)."
- Resources such as a VM and storage for your container are assigned. A new VM is created every time you create or start a codespace to ensure that you always have the latest versions and security patches.
- {% data variables.product.prodname_codespaces %} recieves information about your repository, branch, commits, your public dotfiles repository, and any secrets that you have created.
- {% data variables.product.prodname_codespaces %} executes a shallow clone of the repository.
- If you have one in your repository, {% data variables.product.prodname_codespaces %} runs the `devcontainer.json` file. For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project)."
- Your Docker container, `docker-compose`, or other initialization is run.
- At this point, the codespace is marked as available and you can connect.
- Once the codespace is made available, depending on the commands in the devcontainer, the codespace will continue with some set up.
- The codespace shares ports added in the `devcontainer.json` file.
- The codespace runs anything specified in `postCreateCommand`.
- {% data variables.product.prodname_codespaces %} clones your dotfiles repository to the codespaces environment and looks for an install file. For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/github/developing-online-with-codespaces/personalizing-codespaces-for-your-account)."
- Finally, the codespace does a full clone of the repo so you have full access to it.
{% data reusables.codespaces.about-personalization %} For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/github/developing-online-with-codespaces/personalizing-codespaces-for-your-account)."
{% data reusables.codespaces.use-visual-studio-features %}
@@ -48,4 +58,4 @@ The environment of the codespace you create will be based on the repository's co
![New codespace button](/assets/images/help/codespaces/new-codespace-button.png)

View File

@@ -1,21 +1,31 @@
---
title: Deleting a codespace
intro: You can delete a codespace you no longer need.
product: '{% data reusables.gated-features.codespaces %}'
permissions: Anyone can delete a codespace owned by their user account.
redirect_from:
- /github/developing-online-with-github-codespaces/deleting-a-codespace
- /github/developing-online-with-codespaces/deleting-a-codespace
versions:
free-pro-team: '*'
type: how_to
topics:
- Codespaces
- Fundamentals
- Developer
---
{% data reusables.codespaces.release-stage %}
{% data reusables.codespaces.concurrent-codespace-limit %}
{% data reusables.codespaces.navigate-to-codespaces %}
2. To the right of the codespace you want to delete, click **Delete**.
1. Navigate to the repository where you created the codespace. Select **{% octicon "codespaces" aria-label="The codespaces icon" %} Codespaces** and then click {% octicon "gear" aria-label="The Settings gear" %}. This will display all {% data variables.product.prodname_codespaces %} that you have created in the repository.
![Codespaces tab](/assets/images/help/codespaces/codespaces-manage.png)
Alternatively, you can see every codespace owned by your user account at [github.com/codespaces](https://github.com/codespaces).
2. To the right of the codespace you want to delete, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %}, then click **{% octicon "trash" aria-label="The trash icon" %} Delete**
![Delete button](/assets/images/help/codespaces/delete-codespace.png)
### Deleting a codespace in {% data variables.product.prodname_vscode %}
For information on deleting a codespace in {% data variables.product.prodname_vscode %}, see "[Using Codespaces in Visual Studio Code](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code#deleting-a-codespace-in-visual-studio-code)."

View File

@@ -1,33 +1,56 @@
---
title: Developing in a codespace
intro: 'You can open a codespace on {% data variables.product.product_name %}, then develop using {% data variables.product.prodname_vscode %}''s features.'
product: '{% data reusables.gated-features.codespaces %}'
permissions: Anyone can develop in a codespace owned by their user account.
redirect_from:
- /github/developing-online-with-github-codespaces/developing-in-a-codespace
- /github/developing-online-with-codespaces/developing-in-a-codespace
versions:
free-pro-team: '*'
type: how_to
topics:
- Codespaces
- Fundamentals
- Developer
---
### About development with {% data variables.product.prodname_codespaces %}
{% data reusables.codespaces.release-stage %}
{% data reusables.codespaces.use-visual-studio-features %}
### About development with {% data variables.product.prodname_codespaces %}
{% data reusables.codespaces.about-port-forwarding %} For more information, see "[Forwarding ports in your codespace](/github/developing-online-with-codespaces/forwarding-ports-in-your-codespace)."
{% data variables.product.prodname_codespaces %} provides you with the full development experience of {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.use-visual-studio-features %}
{% data reusables.codespaces.apply-devcontainer-changes %} For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#apply-changes-to-your-configuration)."
![Codespace overview with annotations](/assets/images/help/codespaces/codespace-overview-annotated.png)
{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting your codespace](/github/developing-online-with-codespaces/troubleshooting-your-codespace)."
1. Side Bar - By default, this area shows your project files in the Explorer.
2. Activity Bar - This displays the Views and provides you with a way to switch between them. You can reorder the Views by dragging and dropping them.
3. Editor - This is where you edit your files. You can use the tab for each editor to position it exactly where you need it.
4. Panels - This is where you can see output and debug information, as well as the default place for the integrated Terminal.
5. Status Bar - This area provides you with useful information about your codespace and project. For example, the branch name, configured ports, and more.
For more information on using {% data variables.product.prodname_vscode %}, see the [User Interface guide](https://code.visualstudio.com/docs/getstarted/userinterface) in the {% data variables.product.prodname_vscode %} documentation.
{% data reusables.codespaces.connect-to-codespace-from-vscode %}
### Navigating to your codespace
{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting your codespace](/github/developing-online-with-codespaces/troubleshooting-your-codespace)."
{% data reusables.codespaces.navigate-to-codespaces %}
#### Personalizing your codespace
{% data reusables.codespaces.about-personalization %} For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)."
{% data reusables.codespaces.apply-devcontainer-changes %} For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#apply-changes-to-your-configuration)."
#### Running your app from a codespace
{% data reusables.codespaces.about-port-forwarding %} For more information, see "[Forwarding ports in your codespace](/github/developing-online-with-codespaces/forwarding-ports-in-your-codespace)."
#### Committing your changes
{% data reusables.codespaces.committing-link-to-procedure %}
### Navigating to an existing codespace
1. {% data reusables.codespaces.you-can-see-all-your-codespaces %}
2. Click the name of the codespace you want to develop in.
![Name of codespace](/assets/images/help/codespaces/click-name-codespace.png)
Alternatively, you can see any active codespaces for a repository by navigating to the repository in which it was made and selecting **{% octicon "codespaces" aria-label="The codespaces icon" %} Codespaces**.

View File

@@ -1,15 +1,19 @@
---
title: Forwarding ports in your codespace
intro: '{% data reusables.codespaces.about-port-forwarding %}'
product: '{% data reusables.gated-features.codespaces %}'
versions:
free-pro-team: '*'
redirect_from:
- /github/developing-online-with-codespaces/forwarding-ports-in-your-codespace
type: how_to
topics:
- Codespaces
- Fundamentals
- Developer
---
{% data reusables.codespaces.release-stage %}
### About forwarded ports
Port forwarding gives you access to TCP ports running within your codespace. For example, if you're running a web application on port 4000, you can access the application from your browser to test and debug the application.
@@ -52,7 +56,7 @@ If you want to share a forwarded port with others, you can make the port public.
### Adding a port to the codespace configuration
You can add a forwarded port to the {% data variables.product.prodname_codespaces %} configuration for the repository, so the port will automatically be forwarded for all codespaces created from the repository. After you update the configuration, any previously created codespaces must be rebuilt for the change to apply. For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces#applying-changes-to-your-configuration)."
You can add a forwarded port to the {% data variables.product.prodname_codespaces %} configuration for the repository, so the port will automatically be forwarded for all codespaces created from the repository. After you update the configuration, any previously created codespaces must be rebuilt for the change to apply. For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)."
You can manually configure fowarded ports in a `.devcontainer.json` file using the `forwardPorts` property, or you can use the "Ports" panel in your codespace.

View File

@@ -1,7 +1,6 @@
---
title: Developing in a codespace
intro: 'Create a codespace to get started with developing your project inside a dedicated cloud environment. You can use forwarded ports to run your application and even use codespaces inside {% data variables.product.prodname_vscode %}'
product: '{% data reusables.gated-features.codespaces %}'
versions:
free-pro-team: '*'
topics:
@@ -14,6 +13,8 @@ topics:
{% link_with_intro /developing-in-a-codespace %}
{% link_with_intro /using-source-control-in-your-codespace %}
{% link_with_intro /deleting-a-codespace %}
{% link_with_intro /forwarding-ports-in-your-codespace %}

View File

@@ -1,15 +1,17 @@
---
title: Using Codespaces in Visual Studio Code
intro: 'You can develop in your codespace directly in {% data variables.product.prodname_vscode %} by connecting the {% data variables.product.prodname_github_codespaces %} extension with your account on {% data variables.product.product_name %}.'
product: '{% data reusables.gated-features.codespaces %}'
redirect_from:
- /github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code
- /github/developing-online-with-codespaces/connecting-to-your-codespace-from-visual-studio-code
- /github/developing-online-with-codespaces/using-codespaces-in-visual-studio
versions:
free-pro-team: '*'
type: how_to
topics:
- Codespaces
- Visual Studio Code
- Developer
---
{% data reusables.codespaces.release-stage %}
@@ -18,7 +20,21 @@ topics:
To develop in a codespace directly in {% data variables.product.prodname_vscode %}, you must sign into the {% data variables.product.prodname_github_codespaces %} extension. The {% data variables.product.prodname_github_codespaces %} extension requires {% data variables.product.prodname_vscode %} October 2020 Release 1.51 or later.
1. Use the {% data variables.product.prodname_vs %} Marketplace to install the [{% data variables.product.prodname_github_codespaces %}](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) extension. For more information, see [Extension Marketplace](https://code.visualstudio.com/docs/editor/extension-gallery) in the {% data variables.product.prodname_vscode %} documentation.
Use the {% data variables.product.prodname_vs %} Marketplace to install the [{% data variables.product.prodname_github_codespaces %}](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) extension. For more information, see [Extension Marketplace](https://code.visualstudio.com/docs/editor/extension-gallery) in the {% data variables.product.prodname_vscode %} documentation.
{% mac %}
{% data reusables.codespaces.click-remote-explorer-icon-vscode %}
2. Click **Sign in to view {% data variables.product.prodname_dotcom %}...**.
![Signing in to view {% data variables.product.prodname_codespaces %}](/assets/images/help/codespaces/sign-in-to-view-codespaces-vscode-mac.png)
3. To authorize {% data variables.product.prodname_vscode %} to access your account on {% data variables.product.product_name %}, click **Allow**.
4. Sign in to {% data variables.product.product_name %} to approve the extension.
{% endmac %}
{% windows %}
{% data reusables.codespaces.click-remote-explorer-icon-vscode %}
2. Use the "REMOTE EXPLORER" drop-down, then click **{% data variables.product.prodname_github_codespaces %}**.
![The {% data variables.product.prodname_codespaces %} header](/assets/images/help/codespaces/codespaces-header-vscode.png)
@@ -27,6 +43,8 @@ To develop in a codespace directly in {% data variables.product.prodname_vscode
4. To authorize {% data variables.product.prodname_vscode %} to access your account on {% data variables.product.product_name %}, click **Allow**.
5. Sign in to {% data variables.product.product_name %} to approve the extension.
{% endwindows %}
### Creating a codespace in {% data variables.product.prodname_vscode %}
After you connect your {% data variables.product.product_name %} account to the {% data variables.product.prodname_github_codespaces %} extension, you can develop in a codespace that you created on {% data variables.product.product_name %} or in {% data variables.product.prodname_vscode %}.

View File

@@ -0,0 +1,93 @@
---
title: Using source control in your codespace
intro: 'After making changes to a file in your codespace you can quickly commit the changes and push your update to the remote repository.'
versions:
free-pro-team: '*'
type: how_to
topics:
- Codespaces
- Fundamentals
- Developer
---
{% data reusables.codespaces.release-stage %}
### About source control in {% data variables.product.prodname_codespaces %}
You can perform all the Git actions you need directly within your codespace. For example, you can fetch changes from the remote repository, switch branches, create a new branch, commit and push changes, and create a pull request. You can use the integrated terminal within your codespace to enter Git commands, or you can click icons and menu options to complete all the most common Git tasks. This guide explains how to use the graphical user interface for source control.
Source control in {% data variables.product.prodname_github_codespaces %} uses the same workflow as {% data variables.product.prodname_vscode %}. For more information, see the {% data variables.product.prodname_vscode %} documentation "[Using Version Control in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)."
A typical workflow for updating a file using {% data variables.product.prodname_github_codespaces %} would be:
* From the default branch of your repository on {% data variables.product.prodname_dotcom %}, create a codespace. See "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace)."
* In your codespace, create a new branch to work on.
* Make your changes and save them.
* Commit the change.
* Raise a pull request.
### Creating or switching branches
1. If the current branch is not shown in the status bar, at the bottom of your codespace, right-click the status bar and select **Source control**.
1. Click the branch name in the status bar.
![The branch in the status bar](/assets/images/help/codespaces/branch-in-status-bar.png)
1. In the drop-down, either click the branch you want to switch to, or enter the name for a new branch and click **Create new branch**.
![Choose from the branch menu](/assets/images/help/codespaces/create-new-branch.png)
{% tip %}
**Tip**: If someone has changed a file on the remote repository, in the branch you switched to, you will not see those changes until you pull the changes into your codespace.
{% endtip %}
### Pulling changes from the remote repository
You can pull changes from the remote repository into your codespace at any time.
{% data reusables.codespaces.source-control-display-dark %}
1. At the top of the side bar, click the ellipsis (**...**).
![Ellipsis button for View and More Actions](/assets/images/help/codespaces/source-control-ellipsis-button.png)
1. In the drop-down menu, click **Pull**.
If a dev container has been changed since you created the codespace you can apply the changes by rebuilding the container for the codespace. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)."
### Setting your codespace to automatically fetch new changes
You can set your codespace to automatically fetch details of any new commits that have been made to the remote repository. This allows you to see whether your local copy of the repository is out of date, in which case you may choose to pull in the new changes.
If the fetch operation detects new changes on the remote repository, you'll see the number of new commits in the status bar. You can then pull the changes into your local copy.
1. Click the **Manage** button at the bottom of the Activity Bar.
![Manage button](/assets/images/help/codespaces/manage-button.png)
1. In the menu, slick **Settings**.
1. On the Settings page, search for: `autofetch`.
![Search for autofetch](/assets/images/help/codespaces/autofetch-search.png)
1. To fetch details of updates for all remotes registered for the current repository, set **Git: Autofetch** to `all`.
![Enable Git autofetch](/assets/images/help/codespaces/autofetch-all.png)
1. If you want to change the number of seconds between each automatic fetch, edit the value of **Git: Autofetch Period**.
### Committing your changes
{% data reusables.codespaces.source-control-display-dark %}
1. To stage your changes, click **+** next to the file you've changed, or next to **Changes** if you've changed multiple files and you want to stage them all.
![Source control side bar with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-stage.png)
1. Type a commit message describing the change you've made.
![Source control side bar with a commit message](/assets/images/help/codespaces/codespaces-commit-commit-message.png)
1. To commit your staged changes, click the check mark at the top the source control side bar.
![Click the check mark icon](/assets/images/help/codespaces/codespaces-commit-checkmark-icon.png)
### Raising a pull request
1. After you've committed changes to your local copy of the repository, click the **Create Pull Request** icon.
![Source control side bar with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-pr-button.png)
1. Check that the local branch and repository you're merging from, and the remote branch and repository you're merging into, are correct. Then give the pull request a title and a description.
![Source control side bar with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-pr.png)
1. Click **Create**.
### Pushing changes to your remote repository
You can push the changes you've made. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}.
1. At the top of the side bar, click the ellipsis (**...**).
![Ellipsis button for View and More Actions](/assets/images/help/codespaces/source-control-ellipsis-button-nochanges.png)
1. In the drop-down menu, click **Push**.

View File

@@ -1,62 +0,0 @@
---
title: About Codespaces
intro: '{% data variables.product.prodname_codespaces %} is an online development environment, hosted by {% data variables.product.prodname_dotcom %} and powered by {% data variables.product.prodname_vscode %}, that allows you to develop entirely in the cloud.'
product: '{% data reusables.gated-features.codespaces %}'
redirect_from:
- /github/developing-online-with-github-codespaces/about-github-codespaces
- /github/developing-online-with-codespaces/about-codespaces
versions:
free-pro-team: '*'
topics:
- Codespaces
---
{% note %}
**Note:** {% data variables.product.prodname_codespaces %} is currently in limited public beta and subject to change. During the beta period, {% data variables.product.prodname_dotcom %} does not make any guarantees about the availability of {% data variables.product.prodname_codespaces %}. For more information about joining the beta, see "[Joining the beta](/github/developing-online-with-codespaces/about-codespaces#joining-the-beta)."
{% endnote %}
### About {% data variables.product.prodname_codespaces %}
{% data variables.product.prodname_codespaces %} is a cloud development environment available in your browser. A codespace includes everything you need to develop for a specific repository, including a text editor with syntax highlighting and autocomplete, a terminal, debugging tools, and Git commands, all within {% data variables.product.prodname_dotcom %}. You can also install {% data variables.product.prodname_vscode %} extensions in your codespace to add more functionality.
{% data variables.product.prodname_codespaces %} makes it easier for developers to onboard to a new company or start contributing to an open-source project. Project maintainers can configure a repository so that, when you create a codespace for the repository, the project's dependencies are included automatically. You can start coding faster by reducing time spent configuring your environment.
{% data variables.product.prodname_codespaces %} allows you to develop in the cloud instead of locally. Developers can contribute from anywhere, on any machine, including tablets or Chromebooks, and there is no need to maintain local copies of intellectual property.
![An open codespace](/assets/images/help/codespaces/codespace-overview.png)
### Using {% data variables.product.prodname_codespaces %}
Each developer can create one or more codespace for any public repository, or for any private repository owned by their user account. {% data reusables.codespaces.unsupported-repos %} {% data reusables.codespaces.codespaces-are-personal %}
{% data reusables.codespaces.codespaces-are-per-branch %} {% data reusables.codespaces.concurrent-codespace-limit %} For more information, see "[Deleting a codespace](/github/developing-online-with-codespaces/deleting-a-codespace)."
{% data reusables.codespaces.use-visual-studio-features %}
{% data reusables.codespaces.connect-to-codespace-from-vscode %}
{% data reusables.codespaces.about-configuration %} For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project)."
{% data reusables.codespaces.about-personalization %} For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/github/developing-online-with-codespaces/personalizing-codespaces-for-your-account)."
You can configure settings to add encrypted secrets, enable GPG verification, and allow codespaces to access other repositories. For more information, see "[Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/managing-encrypted-secrets-for-codespaces)", "[Managing GPG verification for {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/managing-gpg-verification-for-codespaces)", and "[Managing access and security for {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/managing-access-and-security-for-codespaces)."
{% data reusables.codespaces.you-can-see-all-your-codespaces %}
{% data reusables.codespaces.beta-functionality-limited %}
### About billing for {% data variables.product.prodname_codespaces %}
{% data reusables.codespaces.about-billing-for-codespaces %} For more information, see "[About billing for {% data variables.product.prodname_codespaces %}](/github/developing-online-with-codespaces/about-billing-for-codespaces)."
### Joining the beta
A limited number of people will be invited to join the beta. To join the waitlist, see [Sign up for Codespaces beta](https://github.com/features/codespaces/signup).
### Contacting us about {% data variables.product.prodname_codespaces %}
If you encounter problems using {% data variables.product.prodname_codespaces %}, see "[Troubleshooting your codespace](/github/developing-online-with-codespaces/troubleshooting-your-codespace)."
If you still need help or have feedback about {% data variables.product.prodname_codespaces %}, use the [Codespaces Feedback](https://github.com/github/feedback/discussions/categories/codespaces-feedback) discussion.

View File

@@ -0,0 +1,223 @@
---
title: Getting started with your C# (.NET) project in Codespaces
shortTitle: Getting started with your C# (.NET) project
allowTitleToDifferFromFilename: true
intro: 'Get started with your C# (.NET) project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
versions:
free-pro-team: '*'
topics:
- Codespaces
---
{% data reusables.codespaces.release-stage %}
### Introduction
This guide shows you how to set up your C# (.NET) project in {% data variables.product.prodname_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
#### Prerequisites
- You should have an existing C# (.NET) project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/2percentsilk/dotnet-quickstart.
- You must have {% data variables.product.prodname_codespaces %} enabled for your organization.
### Step 1: Open your project in a codespace
1. Navigate to your project's repository. Use the {% octicon "download" aria-label="The download icon" %} **Code** drop-down menu, and select **Open with Codespaces**. If you dont see this option, your project isnt available for {% data variables.product.prodname_codespaces %}.
![Open with Codespaces button](/assets/images/help/codespaces/open-with-codespaces-button.png)
2. To create a new codespace, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
![New codespace button](/assets/images/help/codespaces/new-codespace-button.png)
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including .NET. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
### Step 2: Add a dev container to your codespace from a template
The default codespaces container comes with the latest .NET version and common tools preinstalled. However, we encourage you to set up a custom container so you can tailor the tools and scripts that run as part of codespace creation to your project's needs and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project
](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
2. For this example, click **C# (.NET)**. If you need additional features you can select any container thats specific to C# (.NET) or a combination of tools such as C# (.NET) and MS SQL.
![Select C# (.NET) option from the list](/assets/images/help/codespaces/add-dotnet-prebuilt-container.png)
3. Click the recommended version of .NET.
![.NET version selection](/assets/images/help/codespaces/add-dotnet-version.png)
4. Accept the default option to add Node.js to your customization.
![Add Node.js selection](/assets/images/help/codespaces/dotnet-options.png)
5. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
#### Anatomy of your dev container
Adding the C# (.NET) dev container template adds a `.devcontainer` folder to the root of your project's repository with the following files:
- `devcontainer.json`
- Dockerfile
The newly added `devcontainer.json` file defines a few properties that are described after the sample.
##### devcontainer.json
```json
{
"name": "C# (.NET)",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0
"VARIANT": "5.0",
// Options
"INSTALL_NODE": "true",
"NODE_VERSION": "lts/*",
"INSTALL_AZURE_CLI": "false"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// [Optional] To reuse of your local HTTPS dev cert:
//
// 1. Export it locally using this command:
// * Windows PowerShell:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
// * macOS/Linux terminal:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
//
// 2. Uncomment these 'remoteEnv' lines:
// "remoteEnv": {
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
// },
//
// 3. Do one of the following depending on your scenario:
// * When using GitHub Codespaces and/or Remote - Containers:
// 1. Start the container
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
//
// * If only using Remote - Containers with a local container, uncomment this line instead:
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "dotnet restore",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
```
- **Name** - You can name our dev container anything, this is just the default.
- **Build** - The build properties.
- **Dockerfile** - In the build object, `dockerfile` is a reference to the Dockerfile that was also added from the template.
- **Args**
- **Variant**: This file only contains one build argument, which is the .NET Core version that we want to use.
- **Settings** - These are {% data variables.product.prodname_vscode %} settings.
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
- **Extensions** - These are extensions included by default.
- **ms-dotnettools.csharp** - The Microsoft C# extension provides rich support for developing in C#, including features such as IntelliSense, linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more.
- **forwardPorts** - Any ports listed here will be forwarded automatically.
- **postCreateCommand** - If you want to run anything after you land in your codespace thats not defined in the Dockerfile, like `dotnet restore`, you can do that here.
- **remoteUser** - By default, youre running as the vscode user, but you can optionally set this to root.
##### Dockerfile
```bash
# [Choice] .NET version: 5.0, 3.1, 2.1
ARG VARIANT="5.0"
FROM mcr.microsoft.com/vscode/devcontainers/dotnetcore:0-${VARIANT}
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# [Option] Install Azure CLI
ARG INSTALL_AZURE_CLI="false"
COPY library-scripts/azcli-debian.sh /tmp/library-scripts/
RUN if [ "$INSTALL_AZURE_CLI" = "true" ]; then bash /tmp/library-scripts/azcli-debian.sh; fi \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
```
You can use the Dockerfile to add additional container layers to specify OS packages, node versions, or global packages we want included in our container.
### Step 3: Modify your devcontainer.json file
With your dev container added and a basic understanding of what everything does, you can now make changes to configure it for your environment. In this example, you'll add properties to install extensions and restore your project dependancies when your codespace launches.
1. In the Explorer, expand the `.devcontainer` folder and select the `devcontainer.json` file from the tree to open it.
!["Codespaces: Rebuild Container" in the command palette](/assets/images/help/codespaces/devcontainers-options.png)
2. Update your the `extensions` list in your `devcontainer.json` file to add a few extensions that are useful when working with your project.
```json{:copy}
"extensions": [
"ms-dotnettools.csharp",
"streetsidesoftware.code-spell-checker",
],
```
3. Uncomment the `postCreateCommand` to restore dependencies as part of the codespace setup process.
```json{:copy}
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "dotnet restore",
```
4. To rebuild your container and apply the devcontainer.json changes, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, youll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
5. Check your changes were successfully applied by verifying the "Code Spell Checker" extension was installed.
![Extensions list](/assets/images/help/codespaces/dotnet-extensions.png)
### Step 4: Run your application
In the previous section, you used the `postCreateCommand` to installing a set of packages via pip3. With our dependencies now installed, we can run our application.
1. Run your application by pressing `F5` or entering `dotnet watch run` in your terminal.
2. When your project starts, you should see a toast in the bottom right corner with a prompt to connect to the port your project uses.
![Port forwarding toast](/assets/images/help/codespaces/python-port-forwarding.png)
### Step 5: Commit your changes
{% data reusables.codespaces.committing-link-to-procedure %}
### Next steps
You should now be ready start developing your C# (.NET) project in {% data variables.product.prodname_codespaces %}. Here are some additional resources for more advanced scenarios.
- [Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
- [Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)

View File

@@ -0,0 +1,193 @@
---
title: Getting started with your Java project in Codespaces
shortTitle: Getting started with your Java project
intro: 'Get started with your Java project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
versions:
free-pro-team: '*'
topics:
- Codespaces
---
{% data reusables.codespaces.release-stage %}
### Introduction
This guide shows you how to set up your Java project in {% data variables.product.prodname_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
#### Prerequisites
- You should have an existing Java project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/microsoft/vscode-remote-try-java
- You must have {% data variables.product.prodname_codespaces %} enabled for your organization.
### Step 1: Open your project in a codespace
1. Navigate to your project's repository. Use the {% octicon "download" aria-label="The download icon" %} **Code** drop-down menu, and select **Open with Codespaces**. If you dont see this option, your project isnt available for {% data variables.product.prodname_codespaces %}.
![Open with Codespaces button](/assets/images/help/codespaces/open-with-codespaces-button.png)
2. To create a new codespace, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
![New codespace button](/assets/images/help/codespaces/new-codespace-button.png)
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Java, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
### Step 2: Add a dev container to your codespace from a template
The default codespaces container comes with the latest Java version, package managers (Maven, Gradle), and other common tools preinstalled. However, we recommend that you set up a custom container to define the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
3. For this example, click **Java**. In practice, you could select any container thats specific to Java or a combination of tools such as Java and Azure Functions.
![Select Java option from the list](/assets/images/help/codespaces/add-java-prebuilt-container.png)
4. Click the recommended version of Java.
![Java version selection](/assets/images/help/codespaces/add-java-version.png)
5. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
#### Anatomy of your dev container
Adding the Java dev container template adds a `.devcontainer` folder to the root of your project's repository with the following files:
- `devcontainer.json`
- Dockerfile
The newly added `devcontainer.json` file defines a few properties that are described after the sample.
##### devcontainer.json
```json
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.159.0/containers/java
{
"name": "Java",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Java version: 11, 14
"VARIANT": "11",
// Options
"INSTALL_MAVEN": "true",
"INSTALL_GRADLE": "false",
"INSTALL_NODE": "false",
"NODE_VERSION": "lts/*"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"java.home": "/docker-java-home",
"maven.executable.path": "/usr/local/sdkman/candidates/maven/current/bin/mvn"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vscjava.vscode-java-pack"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
```
- **Name** - You can name your dev container anything, this is just the default.
- **Build** - The build properties.
- **Dockerfile** - In the build object, dockerfile is a reference to the Dockerfile that was also added from the template.
- **Args**
- **Variant**: This file only contains one build argument, which is the Java version that is passed into the Dockerfile.
- **Settings** - These are {% data variables.product.prodname_vscode %} settings that you can set.
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
- **Extensions** - These are extensions included by default.
- **Vscjava.vscode-java-pack** - The Java Extension Pack provides popular extensions for Java development to get you started.
- **forwardPorts** - Any ports listed here will be forwarded automatically.
- **postCreateCommand** - If you want to run anything after you land in your codespace thats not defined in the Dockerfile, you can do that here.
- **remoteUser** - By default, youre running as the `vscode` user, but you can optionally set this to `root`.
##### Dockerfile
```bash
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.159.0/containers/java/.devcontainer/base.Dockerfile
ARG VARIANT="14"
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
# [Optional] Install Maven or Gradle
ARG INSTALL_MAVEN="false"
ARG MAVEN_VERSION=3.6.3
ARG INSTALL_GRADLE="false"
ARG GRADLE_VERSION=5.4.1
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "source /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \
&& if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "source /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi
# [Optional] Install a version of Node.js using nvm for front end dev
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
```
You can use the Dockerfile to add additional container layers to specify OS packages, Java versions, or global packages we want included in our Dockerfile.
### Step 3: Modify your devcontainer.json file
With your dev container added and a basic understanding of what everything does, you can now make changes to configure it for your environment. In this example, you'll add properties to install extensions and your project dependencies when your codespace launches.
1. In the Explorer, select the `devcontainer.json` file from the tree to open it. You might have to exand the `.devcontainer` folder to see it.
!["Codespaces: Rebuild Container" in the command palette](/assets/images/help/codespaces/devcontainers-options.png)
2. Add the following lines to your `devcontainer.json` file after `extensions`.
```json{:copy}
"postCreateCommand": "npm install",
"forwardPorts": [4000],
```
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) on the Visual Studio Code docs.
3. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
![Rebuild container option](/assets/images/help/codespaces/codespaces-rebuild.png)
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, youll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
### Step 4: Run your application
In the previous section, you used the `postCreateCommand` to install a set of packages via npm. You can now use this to run our application with npm.
1. Run your application by pressing `F5`.
2. When your project starts, you should see a toast in the bottom right corner with a prompt to connect to the port your project uses.
![Port forwarding toast](/assets/images/help/codespaces/codespaces-port-toast.png)
### Step 5: Commit your changes
{% data reusables.codespaces.committing-link-to-procedure %}
### Next steps
You should now be ready start developing your Java project in {% data variables.product.prodname_codespaces %}. Here are some additional resources for more advanced scenarios.
- [Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
- [Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)

View File

@@ -1,14 +1,18 @@
---
title: Getting started with your Node.js project in Codespaces
shortTitle: Getting started with your Node.js project
intro: 'You can create a custom dev container with all the tools necessary to get started with your JavaScript, Node.js, or TypeScript project in {% data variables.product.prodname_codespaces %}.'
product: '{% data reusables.gated-features.codespaces %}'
intro: 'Get started with your JavaScript, Node.js, or TypeScript project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
versions:
free-pro-team: '*'
type: tutorial
topics:
- Codespaces
- Developer
- Node
- JavaScript
---
{% data reusables.codespaces.release-stage %}
### Introduction
@@ -30,23 +34,19 @@ This guide shows you how to set up your JavaScript, Node.js, or TypeScript proje
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Node.js, JavaScript, Typescript, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
You can customize your codespace by adjusting the amount of vCPUs and RAM], [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
The next section shows you how to modify your tools by adding a dev container.
### Step 2: Add a dev container to your codespace from a template
The default codespaces container will support running Node.js projects like [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) out of the box. By setting up a custom container you can customize the tools and scripts that run as part of codespace creation and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see [Configuring your codespace](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project).
This example guides you through adding a `devcontainer.json` file from a template.
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
1. Access the command palette (`shift command P` / `shift control P`), then start typing "dev container". Click **Codespaces: Add Development Container Configuration Files...**
!["Codespaces: Add Development Container Configuration Files..." in the command palette](/assets/images/help/codespaces/add-prebuilt-container-command.png)
3. For this example, click **Node.js**. In practice, you could select any container thats specific to Node or a combination of tools such as Node and MongoDB.
3. For this example, click **Node.js**. If you need additional features you can select any container thats specific to Node or a combination of tools such as Node and MongoDB.
![Select Node option from the list](/assets/images/help/codespaces/add-node-prebuilt-container.png)
4. Click the recommended version of Node.js.
![Node.js version selection](/assets/images/help/codespaces/add-node-version.png)
@@ -96,18 +96,18 @@ The newly added `devcontainer.json` file defines a few properties that are descr
}
```
- **Name** - We can name our dev container anything, this is just the default
- **Build** - Our build properties
- **Dockerfile** - In our build object, Dockerfile is a reference to the Dockerfile in the same folder that was the second file added to our project. This is the reference path.
- **Name** - You can name your dev container anything, this is just the default.
- **Build** - The build properties.
- **dockerfile** - In the build object, dockerfile is a reference to the Dockerfile that was also added from the template.
- **Args**
- **Variant**: We only have one build argument here which is the node variant we want to use which is passed into our Dockerfile.
- **Settings** - These are {% data variables.product.prodname_vscode %} settings we wish to set
- **Terminal.integrated.shell.linux** - While bash is the default here, we could use zsh for example by modifying this.
- **Variant**: This file only contains one build argument, which is the node variant we want to use that is passed into the Dockerfile.
- **Settings** - These are {% data variables.product.prodname_vscode %} settings that you can set.
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
- **Extensions** - These are extensions included by default.
- **Dbaeumer.vscode-eslint** - ES lint is a great extension for linting, but for JavaScript there are a number of great Marketplace extensions you could also include.
- **forwardPorts** - By default we can forward a port, like port 3000, but these will also forward automatically
- **postCreateCommand** - If we want to run anything after we land in our codespace thats not defined in our Dockerfile, like yarn install or npm install, we can do that here
- **remoteUser** - Were running as the node user, but you can optionally set this to root
- **forwardPorts** - Any ports listed here will be forwarded automatically.
- **postCreateCommand** - If you want to run anything after you land in your codespace thats not defined in the Dockerfile, you can do that here.
- **remoteUser** - By default, youre running as the vscode user, but you can optionally set this to root.
##### Dockerfile
@@ -145,7 +145,7 @@ With your dev container added and a basic understanding of what everything does,
"forwardPorts": [4000],
```
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) on the Visual Studio Code docs.
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) in the {% data variables.product.prodname_vscode %} docs.
3. To rebuild your container, access the command palette (`shift command P` / `shift control P`), then start typing "rebuild". Click **Codespaces: Rebuild Container**.
@@ -168,33 +168,12 @@ In the previous section, you used the `postCreateCommand` to installing a set of
### Step 5: Commit your changes
Once you've made changes to your codespace, either new code or configuration changes, you'll want to commit your changes. Committing changes to your repository ensures that anyone else who creates a codespace from this repository has the same configuration. This also means that any customization you do, such as adding {% data variables.product.prodname_vscode %} extensions, will appear for all users.
1. In the Activity Bar, click on the **Source Control** view.
![Source control view](/assets/images/help/codespaces/codespaces-commit-activity.png)
2. To stage your changes, click **+**.
![Explorer with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-stage.png)
3. Type a commit message and then use `Ctrl+Enter` / `cmd+Enter` to commit the changes.
![Explorer with commit message added](/assets/images/help/codespaces/codespaces-commit-commit-message.png)
4. To create a PR, click the PR icon.
![Explorer with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-pr-button.png)
5. Select the branches that you want to merge into, then click **Create**.
![Explorer with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-pr.png)
{% data reusables.codespaces.committing-link-to-procedure %}
### Next steps
You should now be ready start developing your JavaScript project in {% data variables.product.prodname_codespaces %}. Here are some additional resources for more advanced scenarios.
- [Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
- [Managing encrypted secrets for your codespaces](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/managing-your-codespaces/managing-gpg-verification-for-codespaces)
- [Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)

View File

@@ -1,14 +1,17 @@
---
title: Getting started with your Python project in Codespaces
shortTitle: Getting started with your Python project
intro: 'You can create a custom dev container with all the tools necessary to get started with your Python project in {% data variables.product.prodname_codespaces %}.'
product: '{% data reusables.gated-features.codespaces %}'
intro: 'Get started with your Python project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
versions:
free-pro-team: '*'
type: tutorial
topics:
- Codespaces
- Developer
- Python
---
{% data reusables.codespaces.release-stage %}
### Introduction
@@ -199,27 +202,7 @@ In the previous section, you used the `postCreateCommand` to install a set of pa
### Step 5: Commit your changes
Once you've made changes to your codespace, either new code or configuration changes, you'll want to commit your changes. Committing changes to your repository ensures that anyone else who creates a codespace from this repository has the same configuration. This also means that any customization you do, such as adding {% data variables.product.prodname_vscode %} extensions, will appear for all users.
1. In the Activity Bar, click on the **Source Control** view.
![Source control view](/assets/images/help/codespaces/codespaces-commit-activity.png)
2. To stage your changes, click **+**.
![Explorer with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-stage.png)
3. Type a commit message and then use `Ctrl+Enter` / `cmd+Enter` to commit the changes.
![Explorer with commit message added](/assets/images/help/codespaces/codespaces-commit-commit-message.png)
4. To create a PR, click the PR icon.
![Explorer with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-pr-button.png)
5. Select the branches that you want to merge into, then click **Create**.
![Explorer with staging button highlighted](/assets/images/help/codespaces/codespaces-commit-pr.png)
{% data reusables.codespaces.committing-link-to-procedure %}
### Next steps

View File

@@ -5,11 +5,13 @@ versions:
free-pro-team: '*'
---
{% link_with_intro /about-codespaces %}
{% link_with_intro /about-billing-for-codespaces %}
{% data reusables.codespaces.release-stage %}
{% link_with_intro /getting-started-with-your-nodejs-project-in-codespaces %}
{% link_with_intro /getting-started-with-your-dotnet-project %}
{% link_with_intro /getting-started-with-your-java-project-in-codespaces %}
{% link_with_intro /getting-started-with-your-python-project-in-codespaces %}

View File

@@ -0,0 +1,27 @@
---
title: Codespaces guides
shortTitle: Guides
intro: Learn how to make the most of GitHub {% data reusables.gated-features.codespaces %}
allowTitleToDifferFromFilename: true
layout: product-sublanding
versions:
free-pro-team: '*'
includeGuides:
- /codespaces/quickstart
- /codespaces/getting-started-with-codespaces/getting-started-with-your-nodejs-project-in-codespaces
- /codespaces/getting-started-with-codespaces/getting-started-with-your-python-project-in-codespaces
- /codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project
- /codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account
- /codespaces/developing-in-codespaces/creating-a-codespace
- /codespaces/developing-in-codespaces/developing-in-a-codespace
- /codespaces/developing-in-codespaces/deleting-a-codespace
- /codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace
- /codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code
- /codespaces/developing-in-codespaces/using-source-control-in-your-codespace
- /codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces
- /codespaces/managing-your-codespaces/managing-access-and-security-for-your-codespaces
- /codespaces/managing-your-codespaces/managing-gpg-verification-for-codespaces
- /codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces
- /codespaces/managing-codespaces-for-your-organization/managing-user-permissions-for-your-organization
- /codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-codespaces
---

View File

@@ -1,22 +1,42 @@
---
title: 'Developing online with {% data variables.product.prodname_codespaces %}'
shortTitle: Codespaces
intro: 'You can develop entirely in the cloud using {% data variables.product.prodname_codespaces %}, an integrated development environment (IDE) on {% data variables.product.prodname_dotcom %}.'
product: '{% data reusables.gated-features.codespaces %}'
title: GitHub Codespaces Documentation
beta_product: true
shortTitle: GitHub Codespaces
intro: 'Create a codespace to start developing in a secure, configurable, and dedicated development environment that works how and where you want it to.'
introLinks:
quickstart: /codespaces/quickstart
overview: /codespaces/about-codespaces
featuredLinks:
guides:
- /codespaces/getting-started-with-codespaces/getting-started-with-your-nodejs-project-in-codespaces
- /codespaces/getting-started-with-codespaces/getting-started-with-your-python-project-in-codespaces
- /codespaces/getting-started-with-codespaces/getting-started-with-your-java-project-in-codespaces
- /codespaces/getting-started-with-codespaces/getting-started-with-your-dotnet-project
guideCards:
- /codespaces/developing-in-codespaces/creating-a-codespace
- /codespaces/developing-in-codespaces/developing-in-a-codespace
- /codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code
- /codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account
popular:
- /codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project
- /codespaces/managing-codespaces-for-your-organization/managing-user-permissions-for-your-organization
- /codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces
- /codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-codespaces
popularHeading: Managing GitHub Codespaces
product_video: https://www.youtube-nocookie.com/embed/_W9B7qc9lVc
redirect_from:
- /github/developing-online-with-github-codespaces
- /github/developing-online-with-codespaces
layout: product-landing
versions:
free-pro-team: '*'
topics:
- Codespaces
---
{% data reusables.codespaces.release-stage %}
### Table of Contents
{% link_in_list /getting-started-with-codespaces %}
{% link_in_list /setting-up-your-codespace %}
{% link_in_list /developing-in-codespaces %}
{% link_in_list /working-with-your-codespace %}
<!-- {% link_in_list /about-codespaces %} -->
<!-- {% link_in_list /quickstart %} -->
<!-- {% link_in_list /getting-started-with-codespaces %} -->
<!-- {% link_in_list /setting-up-your-codespace %} -->
<!-- {% link_in_list /developing-in-codespaces %} -->
<!-- {% link_in_list /managing-your-codespaces %} -->
<!-- {% link_in_list /managing-codespaces-for-your-organization %} -->
<!-- {% link_in_list /codespaces-reference %} -->

Some files were not shown because too many files have changed in this diff Show More