diff --git a/assets/images/help/repository/actions-failed-pester-test.png b/assets/images/help/repository/actions-failed-pester-test.png new file mode 100644 index 000000000000..bc19a4f33fb8 Binary files /dev/null and b/assets/images/help/repository/actions-failed-pester-test.png differ diff --git a/content/actions/guides/building-and-testing-powershell.md b/content/actions/guides/building-and-testing-powershell.md new file mode 100644 index 000000000000..b600e09d160f --- /dev/null +++ b/content/actions/guides/building-and-testing-powershell.md @@ -0,0 +1,236 @@ +--- +title: Building and testing PowerShell +intro: You can create a continuous integration (CI) workflow to build and test your PowerShell project. +product: '{% data reusables.gated-features.actions %}' +versions: + free-pro-team: '*' + enterprise-server: '>=2.22' +--- + +{% data reusables.actions.enterprise-beta %} +{% data reusables.actions.enterprise-github-hosted-runners %} + +### Introduction + +This guide shows you how to use PowerShell for CI. It describes how to use Pester, install dependencies, test your module, and publish to the PowerShell Gallery. + +{% data variables.product.prodname_dotcom %}-hosted runners have a tools cache with pre-installed software, which includes PowerShell and Pester. For a full list of up-to-date software and the pre-installed versions of PowerShell and Pester, see "[Specifications for {% data variables.product.prodname_dotcom %}-hosted runners](/actions/reference/specifications-for-github-hosted-runners/#supported-software)". + +### Prerequisites + +You should be familiar with YAML and the syntax for {% data variables.product.prodname_actions %}. For more information, see "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)." + +We recommend that you have a basic understanding of PowerShell and Pester. For more information, see: +- [Getting started with PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started) +- [Pester](https://pester.dev) + +{% data reusables.actions.enterprise-setup-prereq %} + +### Adding a workflow for Pester + +To automate your testing with PowerShell and Pester, you can add a workflow that runs every time a change is pushed to your repository. In the following example, `Test-Path` is used to check that a file called `resultsfile.log` is present. + +This example workflow file must be added to your repository's `.github/workflows/` directory: + +{% raw %} +```yaml +name: Test PowerShell on Ubuntu +on: push + +jobs: + pester-test: + name: Pester test + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Perform a Pester test from the command-line + shell: pwsh + run: Test-Path resultsfile.log | Should -Be $true + - name: Perform a Pester test from the Tests.ps1 file + shell: pwsh + run: | + Invoke-Pester Unit.Tests.ps1 -Passthru +``` +{% endraw %} + +* `shell: pwsh` - Configures the job to use PowerShell when running the `run` commands. +* `run: Test-Path resultsfile.log` - Check whether a file called `resultsfile.log` is present in the repository's root directory. +* `Should -Be $true` - Uses Pester to define an expected result. If the result is unexpected, then {% data variables.product.prodname_actions %} flags this as a failed test. For example: + + ![Failed Pester test](/assets/images/help/repository/actions-failed-pester-test.png) + +* `Invoke-Pester Unit.Tests.ps1 -Passthru` - Uses Pester to execute tests defined in a file called `Unit.Tests.ps1`. For example, to perform the same test described above, the `Unit.Tests.ps1` will contain the following: + ``` + Describe "Check results file is present" { + It "Check results file is present" { + Test-Path resultsfile.log | Should -Be $true + } + } + ``` + +### PowerShell module locations + +The table below describes the locations for various PowerShell modules in each {% data variables.product.prodname_dotcom %}-hosted runner. + +|| Ubuntu | macOS | Windows | +|------|-------|------|----------| +|**PowerShell system modules** |`/opt/microsoft/powershell/7/Modules/*`|`/usr/local/microsoft/powershell/7/Modules/*`|`C:\program files\powershell\7\Modules\*`| +|**PowerShell add-on modules**|`/usr/local/share/powershell/Modules/*`|`/usr/local/share/powershell/Modules/*`|`C:\Modules\*`| +|**User-installed modules**|`/home/runner/.local/share/powershell/Modules/*`|`/Users/runner/.local/share/powershell/Modules/*`|`C:\Users\runneradmin\Documents\PowerShell\Modules\*`| + +### Installing dependencies + +{% data variables.product.prodname_dotcom %}-hosted runners have PowerShell 7 and Pester installed. You can use `Install-Module` to install additional dependencies from the PowerShell Gallery before building and testing your code. + +{% note %} + +**Note:** The pre-installed packages (such as Pester) used by {% data variables.product.prodname_dotcom %}-hosted runners are regularly updated, and can introduce signficant changes. As a result, it is recommended that you always specify the required package versions by using `Install-Module` with `-MaximumVersion`. + +{% endnote %} + +You can also cache dependencies to speed up your workflow. For more information, see "[Caching dependencies to speed up your workflow](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)." + +For example, the following job installs the `SqlServer` and `PSScriptAnalyzer` modules: + +{% raw %} +```yaml +jobs: + install-dependencies: + name: Install dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install from PSGallery + shell: pwsh + run: | + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module SqlServer, PSScriptAnalyzer +``` +{% endraw %} + +{% note %} + +**Note:** By default, no repositories are trusted by PowerShell. When installing modules from the PowerShell Gallery, you must explicitly set the installation policy for `PSGallery` to `Trusted`. + +{% endnote %} + +#### Caching dependencies + +You can cache PowerShell dependencies using a unique key, which allows you to restore the dependencies for future workflows with the [`cache`](https://github.com/marketplace/actions/cache) action. For more information, see "[Caching dependencies to speed up workflows](/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows)." + +PowerShell caches its dependencies in different locations, depending on the runner's operating system. For example, the `path` location used in the following Ubuntu example will be different for a Windows operating system. + +{% raw %} +```yaml +steps: + - uses: actions/checkout@v2 + - name: Setup PowerShell module cache + id: cacher + uses: actions/cache@v2 + with: + path: "~/.local/share/powershell/Modules" + key: ${{ runner.os }}-SqlServer-PSScriptAnalyzer + - name: Install required PowerShell modules + if: steps.cacher.outputs.cache-hit != 'true' + shell: pwsh + run: | + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module SqlServer, PSScriptAnalyzer -ErrorAction Stop +``` +{% endraw %} + +### Testing your code + +You can use the same commands that you use locally to build and test your code. + +#### Using PSScriptAnalyzer to lint code + +The following example installs `PSScriptAnalyzer` and uses it to lint all `ps1` files in the repository. For more information, see [PSScriptAnalyzer on GitHub](https://github.com/PowerShell/PSScriptAnalyzer). + +{% raw %} +```yaml + lint-with-PSScriptAnalyzer: + name: Install and run PSScriptAnalyzer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install PSScriptAnalyzer module + shell: pwsh + run: | + Set-PSRepository PSGallery -InstallationPolicy Trusted + Install-Module PSScriptAnalyzer -ErrorAction Stop + - name: Lint with PSScriptAnalyzer + shell: pwsh + run: | + Invoke-ScriptAnalyzer -Path *.ps1 -Recurse -Outvariable issues + $errors = $issues.Where({$_.Severity -eq 'Error'}) + $warnings = $issues.Where({$_.Severity -eq 'Warning'}) + if ($errors) { + Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop + } else { + Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total." + } +``` +{% endraw %} + +### Packaging workflow data as artifacts + +You can upload artifacts to view after a workflow completes. For example, you may need to save log files, core dumps, test results, or screenshots. For more information, see "[Persisting workflow data using artifacts](/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)." + +The following example demonstrates how you can use the `upload-artifact` action to archive the test results received from `Invoke-Pester`. For more information, see the [`upload-artifact` action](https://github.com/actions/upload-artifact). + +{% raw %} +```yaml +name: Upload artifact from Ubuntu + +on: [push] + +jobs: + upload-pester-results: + name: Run Pester and upload results + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Test with Pester + shell: pwsh + run: Invoke-Pester Unit.Tests.ps1 -Passthru | Export-CliXml -Path Unit.Tests.xml + - name: Upload test results + uses: actions/upload-artifact@v2 + with: + name: ubuntu-Unit-Tests + path: Unit.Tests.xml + if: ${{ always() }} +``` +{% endraw %} + +The `always()` function configures the job to continue processing even if there are test failures. For more information, see "[always](/actions/reference/context-and-expression-syntax-for-github-actions#always)." + +### Publishing to PowerShell Gallery + +You can configure your workflow to publish your PowerShell module to the PowerShell Gallery when your CI tests pass. You can use repository secrets to store any tokens or credentials needed to publish your package. For more information, see "[Creating and using encrypted secrets](/github/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)." + +The following example creates a package and uses `Publish-Module` to publish it to the PowerShell Gallery: + +{% raw %} +```yaml +name: Publish PowerShell Module + +on: + release: + types: [created] + +jobs: + publish-to-gallery: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build and publish + env: + NUGET_KEY: ${{ secrets.NUGET_KEY }} + shell: pwsh + run: | + ./build.ps1 -Path /tmp/samplemodule + Publish-Module -Path /tmp/samplemodule -NuGetApiKey $env:NUGET_KEY -Verbose +``` +{% endraw %} diff --git a/content/actions/guides/index.md b/content/actions/guides/index.md index 74739584d287..ed16f5d6226c 100644 --- a/content/actions/guides/index.md +++ b/content/actions/guides/index.md @@ -29,6 +29,7 @@ You can use {% data variables.product.prodname_actions %} to create custom conti {% link_in_list /about-continuous-integration %} {% link_in_list /setting-up-continuous-integration-using-workflow-templates %} {% link_in_list /building-and-testing-nodejs %} +{% link_in_list /building-and-testing-powershell %} {% link_in_list /building-and-testing-python %} {% link_in_list /building-and-testing-java-with-maven %} {% link_in_list /building-and-testing-java-with-gradle %} diff --git a/content/actions/learn-github-actions/introduction-to-github-actions.md b/content/actions/learn-github-actions/introduction-to-github-actions.md index 7c2fa9ec700a..66434457338f 100644 --- a/content/actions/learn-github-actions/introduction-to-github-actions.md +++ b/content/actions/learn-github-actions/introduction-to-github-actions.md @@ -34,7 +34,7 @@ The workflow is an automated procedure that you add to your repository. Workflow #### Events -An event is a specific activity that triggers a workflow. For example, activity can originate from {% data variables.product.prodname_dotcom %} when someone pushes a commit to a repository or when an issue or pull request is created. You can also use the repository dispatch webhook to trigger a workflow when an external event occurs. For a complete list of events that can be used to trigger workflows, see [Events that trigger workflows](/actions/reference/events-that-trigger-workflows). +An event is a specific activity that triggers a workflow. For example, activity can originate from {% data variables.product.prodname_dotcom %} when someone pushes a commit to a repository or when an issue or pull request is created. You can also use the [repository dispatch webhook](/rest/reference/repos#create-a-repository-dispatch-event) to trigger a workflow when an external event occurs. For a complete list of events that can be used to trigger workflows, see [Events that trigger workflows](/actions/reference/events-that-trigger-workflows). #### Jobs diff --git a/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md b/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md index b17745585b5e..bb0910cc2b0e 100644 --- a/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md +++ b/content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md @@ -20,18 +20,26 @@ If you don't want to reenter your passphrase every time you use your SSH key, yo {% data reusables.command_line.open_the_multi_os_terminal %} 2. Paste the text below, substituting in your {% data variables.product.product_name %} email address. ```shell - $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" + $ ssh-keygen -t ed25519 -C "your_email@example.com" ``` + {% note %} + + **Note:** If you are using a legacy system that doesn't support the Ed25519 algorithm, use: + ```shell + $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" + ``` + + {% endnote %} This creates a new ssh key, using the provided email as a label. ```shell - > Generating public/private rsa key pair. + > Generating public/private ed25519 key pair. ``` 3. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location. {% mac %} ```shell - > Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] + > Enter a file in which to save the key (/Users/you/.ssh/id_ed25519): [Press enter] ``` {% endmac %} @@ -39,7 +47,7 @@ If you don't want to reenter your passphrase every time you use your SSH key, yo {% windows %} ```shell - > Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter] + > Enter a file in which to save the key (/c/Users/you/.ssh/id_ed25519):[Press enter] ``` {% endwindows %} @@ -47,7 +55,7 @@ If you don't want to reenter your passphrase every time you use your SSH key, yo {% linux %} ```shell - > Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter] + > Enter a file in which to save the key (/home/you/.ssh/id_ed25519): [Press enter] ``` {% endlinux %} @@ -81,18 +89,18 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav $ touch ~/.ssh/config ``` - * Open your `~/.ssh/config` file, then modify the file, replacing ` ~/.ssh/id_rsa` if you are not using the default location and name for your `id_rsa` key. + * Open your `~/.ssh/config` file, then modify the file, replacing ` ~/.ssh/id_ed25519` if you are not using the default location and name for your `id_ed25519` key. ``` Host * AddKeysToAgent yes UseKeychain yes - IdentityFile ~/.ssh/id_rsa + IdentityFile ~/.ssh/id_ed25519 ``` 3. Add your SSH private key to the ssh-agent and store your passphrase in the keychain. {% data reusables.ssh.add-ssh-key-to-ssh-agent %} ```shell - $ ssh-add -K ~/.ssh/id_rsa + $ ssh-add -K ~/.ssh/id_ed25519 ``` {% note %} diff --git a/content/github/collaborating-with-issues-and-pull-requests/merging-a-pull-request.md b/content/github/collaborating-with-issues-and-pull-requests/merging-a-pull-request.md index 8015940896e7..415b3bc26263 100644 --- a/content/github/collaborating-with-issues-and-pull-requests/merging-a-pull-request.md +++ b/content/github/collaborating-with-issues-and-pull-requests/merging-a-pull-request.md @@ -46,9 +46,15 @@ If you decide you don't want the changes in a topic branch to be merged to the u {% data reusables.files.choose-commit-email %} + {% note %} + + **Note:** The email selector is not available for rebase merges, which do not create a merge commit, or for squash merges, which credit the user who created the pull request as the author of the squashed commit. + + {% endnote %} + 6. Click **Confirm merge**, **Confirm squash and merge**, or **Confirm rebase and merge**. 6. Optionally, [delete the branch](/articles/deleting-unused-branches). This keeps the list of branches in your repository tidy. - + The repository may be configured so that the head branch for a pull request is automatically deleted when you merge a pull request. For more information, see "[Managing the automatic deletion of branches](/github/administering-a-repository/managing-the-automatic-deletion-of-branches)." {% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@latest" or currentVersion ver_gt "enterprise-server@2.21" %} diff --git a/content/github/collaborating-with-issues-and-pull-requests/syncing-a-fork.md b/content/github/collaborating-with-issues-and-pull-requests/syncing-a-fork.md index 68f9557fc2eb..affc3dd844ad 100644 --- a/content/github/collaborating-with-issues-and-pull-requests/syncing-a-fork.md +++ b/content/github/collaborating-with-issues-and-pull-requests/syncing-a-fork.md @@ -13,7 +13,7 @@ Before you can sync your fork with an upstream repository, you must [configure a {% data reusables.command_line.open_the_multi_os_terminal %} 2. Change the current working directory to your local project. -3. Fetch the branches and their respective commits from the upstream repository. Commits to `main` will be stored in a local branch, `upstream/main`. +3. Fetch the branches and their respective commits from the upstream repository. Commits to `BRANCHNAME` will be stored in the local branch `upstream/BRANCHNAME`. ```shell $ git fetch upstream > remote: Counting objects: 75, done. @@ -23,12 +23,12 @@ Before you can sync your fork with an upstream repository, you must [configure a > From https://{% data variables.command_line.codeblock %}/ORIGINAL_OWNER/ORIGINAL_REPOSITORY > * [new branch] main -> upstream/main ``` -4. Check out your fork's local `main` branch. +4. Check out your fork's local default branch - in this case, we use `main`. ```shell $ git checkout main > Switched to branch 'main' ``` -5. Merge the changes from `upstream/main` into your local `main` branch. This brings your fork's `main` branch into sync with the upstream repository, without losing your local changes. +5. Merge the changes from the upstream default branch - in this case, `upstream/main` - into your local default branch. This brings your fork's default branch into sync with the upstream repository, without losing your local changes. ```shell $ git merge upstream/main > Updating a422352..5fdff0f diff --git a/content/github/setting-up-and-managing-your-github-user-account/about-your-personal-dashboard.md b/content/github/setting-up-and-managing-your-github-user-account/about-your-personal-dashboard.md index 4c88c9c0ba14..863031855b69 100644 --- a/content/github/setting-up-and-managing-your-github-user-account/about-your-personal-dashboard.md +++ b/content/github/setting-up-and-managing-your-github-user-account/about-your-personal-dashboard.md @@ -29,6 +29,8 @@ In the left sidebar of your dashboard, you can access the top repositories and t ![list of repositories and teams from different organizations](/assets/images/help/dashboard/repositories-and-teams-from-personal-dashboard.png) +The list of top repositories is automatically generated, and can include any repository you have interacted with, whether it's owned directly by your account or not. Interactions include making commits and opening or commenting on issues and pull requests. The list of top repositories cannot be edited, but repositories will drop off the list 4 months after you last interacted with them. + You can also find a list of your recently visited repositories, teams, and project boards when you click into the search bar at the top of any page on {% data variables.product.product_name %}. ### Staying updated with activity from the community diff --git a/content/github/site-policy/github-ae-data-protection-agreement.md b/content/github/site-policy/github-ae-data-protection-agreement.md index d4daa7155a05..b73651630d77 100644 --- a/content/github/site-policy/github-ae-data-protection-agreement.md +++ b/content/github/site-policy/github-ae-data-protection-agreement.md @@ -2,6 +2,8 @@ title: GitHub AE Data Protection Agreement versions: free-pro-team: '*' +redirect_from: + - /github/site-policy/ghem-data-protection-addendum --- Version Effective Date: November 1, 2020 diff --git a/content/github/site-policy/github-ae-product-specific-terms.md b/content/github/site-policy/github-ae-product-specific-terms.md index 0ea1b11a4d05..52d39d2e3812 100644 --- a/content/github/site-policy/github-ae-product-specific-terms.md +++ b/content/github/site-policy/github-ae-product-specific-terms.md @@ -2,6 +2,8 @@ title: GitHub AE Product Specific Terms versions: free-pro-team: '*' +redirect_from: + - /github/site-policy/ghem-supplemental-terms-for-microsoft-volume-licensing --- Version Effective Date: November 1, 2020 diff --git a/content/github/site-policy/github-privacy-statement.md b/content/github/site-policy/github-privacy-statement.md index 849628ab62ae..81ff6378d189 100644 --- a/content/github/site-policy/github-privacy-statement.md +++ b/content/github/site-policy/github-privacy-statement.md @@ -144,7 +144,7 @@ For more information about our disclosure in response to legal requests, see our We may share User Personal Information if we are involved in a merger, sale, or acquisition of corporate entities or business units. If any such change of ownership happens, we will ensure that it is under terms that preserve the confidentiality of User Personal Information, and we will notify you on our Website or by email before any transfer of your User Personal Information. The organization receiving any User Personal Information will have to honor any promises we made in our Privacy Statement or Terms of Service. #### Aggregate, non-personally identifying information -We share certain aggregated, non-personally identifying information with others about how our users, collectively, use GitHub, or how our users respond to our other offerings, such as our conferences or events. For example, [we may compile statistics on the open source activity across GitHub](https://octoverse.github.com/). +We share certain aggregated, non-personally identifying information with others about how our users, collectively, use GitHub, or how our users respond to our other offerings, such as our conferences or events. We **do not** sell your User Personal Information for monetary or other consideration. diff --git a/content/github/site-policy/index.md b/content/github/site-policy/index.md index f298e351fb0f..2fb09f3fabff 100644 --- a/content/github/site-policy/index.md +++ b/content/github/site-policy/index.md @@ -17,6 +17,7 @@ versions: {% link_in_list /global-privacy-practices %} {% link_in_list /github-enterprise-server-license-agreement %} {% link_in_list /github-ae-data-protection-agreement %} +{% link_in_list /github-ae-product-specific-terms %} {% link_in_list /github-enterprise-service-level-agreement %} {% link_in_list /github-connect-addendum-to-the-github-enterprise-license-agreement %} {% link_in_list /github-supplemental-terms-for-microsoft-volume-licensing %} @@ -25,7 +26,6 @@ versions: {% link_in_list /github-enterprise-cloud-evaluation-agreement %} {% link_in_list /github-sponsors-additional-terms %} {% link_in_list /github-additional-product-terms %} -{% link_in_list /github-ae-product-specific-terms %} {% link_in_list /github-logo-policy %} {% link_in_list /github-username-policy %} {% link_in_list /submitting-content-removal-requests %} diff --git a/content/github/using-git/about-git-subtree-merges.md b/content/github/using-git/about-git-subtree-merges.md index 9a987cedf3ed..57a827365eb5 100644 --- a/content/github/using-git/about-git-subtree-merges.md +++ b/content/github/using-git/about-git-subtree-merges.md @@ -105,5 +105,5 @@ $ git pull -s subtree spoon-knife main ### Further reading -- [The "Subtree Merging" chapter from the _Pro Git_ book](https://git-scm.com/book/en/Git-Tools-Subtree-Merging) +- [The "Advanced Merging" chapter from the _Pro Git_ book](https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging) - "[How to use the subtree merge strategy](https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html)" diff --git a/content/github/working-with-github-pages/about-github-pages.md b/content/github/working-with-github-pages/about-github-pages.md index 322179be556a..c030e487fdbf 100644 --- a/content/github/working-with-github-pages/about-github-pages.md +++ b/content/github/working-with-github-pages/about-github-pages.md @@ -34,9 +34,9 @@ Organization owners can disable the publication of {% data variables.product.pro There are three types of {% data variables.product.prodname_pages %} sites: project, user, and organization. Project sites are connected to a specific project hosted on {% data variables.product.product_name %}, such as a JavaScript library or a recipe collection. User and organization sites are connected to a specific {% data variables.product.product_name %} account. -To publish a user site, you must create a repository owned by your user account that's named {% if currentVersion == "free-pro-team@latest" %}`.github.io`{% else %}`.`{% endif %}. To publish an organization site, you must create a repository owned by an organization that's named {% if currentVersion == "free-pro-team@latest" %}`.github.io`{% else %}`.`{% endif %}. {% if currentVersion == "free-pro-team@latest" %}Unless you're using a custom domain, user and organization sites are available at `http(s)://.github.io` or `http(s)://.github.io`.{% elsif currentVersion == "github-ae@latest" %}User and organization sites are available at `http(s)://pages./` or `http(s)://pages./`.{% endif %} +To publish a user site, you must create a repository owned by your user account that's named {% if currentVersion == "free-pro-team@latest" %}`.github.io`{% else %}`.`{% endif %}. To publish an organization site, you must create a repository owned by an organization that's named {% if currentVersion == "free-pro-team@latest" %}`.github.io`{% else %}`.`{% endif %}. {% if currentVersion == "free-pro-team@latest" %}Unless you're using a custom domain, user and organization sites are available at `http(s)://.github.io` or `http(s)://.github.io`.{% elsif currentVersion == "github-ae@latest" %}User and organization sites are available at `http(s)://pages./` or `http(s)://pages./`.{% endif %} -The source files for a project site are stored in the same repository as their project. {% if currentVersion == "free-pro-team@latest" %}Unless you're using a custom domain, project sites are available at `http(s)://.github.io/` or `http(s)://.github.io/`.{% elsif currentVersion == "github-ae@latest" %}Project sites are available at `http(s)://pages.///` or `http(s)://pages.///`.{% endif %} +The source files for a project site are stored in the same repository as their project. {% if currentVersion == "free-pro-team@latest" %}Unless you're using a custom domain, project sites are available at `http(s)://.github.io/` or `http(s)://.github.io/`.{% elsif currentVersion == "github-ae@latest" %}Project sites are available at `http(s)://pages.///` or `http(s)://pages.///`.{% endif %} {% if currentVersion == "free-pro-team@latest" %} For more information about how custom domains affect the URL for your site, see "[About custom domains and {% data variables.product.prodname_pages %}](/articles/about-custom-domains-and-github-pages)." @@ -60,7 +60,7 @@ For more information, see "[Enabling subdomain isolation](/enterprise/{{ current {% if currentVersion == "free-pro-team@latest" %} {% note %} -**Note:** Repositories using the legacy `.github.com` naming scheme will still be published, but visitors will be redirected from `http(s)://.github.com` to `http(s)://.github.io`. If both a `.github.com` and `.github.io` repository exist, only the `.github.io` repository will be published. +**Note:** Repositories using the legacy `.github.com` naming scheme will still be published, but visitors will be redirected from `http(s)://.github.com` to `http(s)://.github.io`. If both a `.github.com` and `.github.io` repository exist, only the `.github.io` repository will be published. {% endnote %} {% endif %} diff --git a/content/graphql/guides/managing-enterprise-accounts.md b/content/graphql/guides/managing-enterprise-accounts.md index c172cd388757..78342e3bd70f 100644 --- a/content/graphql/guides/managing-enterprise-accounts.md +++ b/content/graphql/guides/managing-enterprise-accounts.md @@ -205,7 +205,7 @@ For more information about getting started with GraphQL, see "[Introduction to G Here's an overview of the new queries, mutations, and schema defined types available for use with the Enterprise Accounts API. -For more details about the new queries, mutations, and schema defined types available for use with the Enterprise Accounts API, see the sdiebar with detailed GraphQL definitions from any [GraphQL reference page](/v4/). +For more details about the new queries, mutations, and schema defined types available for use with the Enterprise Accounts API, see the sidebar with detailed GraphQL definitions from any [GraphQL reference page](/v4/). You can access the reference docs from within the GraphQL explorer on GitHub. For more information, see "[Using the explorer](/v4/guides/using-the-explorer#accessing-the-sidebar-docs)." For other information, such as authentication and rate limit details, check out the [guides](/v4/guides). diff --git a/contributing/README.md b/contributing/README.md index 3c955c424497..6dff199b00e9 100644 --- a/contributing/README.md +++ b/contributing/README.md @@ -6,7 +6,7 @@ Here, you'll find additional information that might be helpful as you work on a - [development](./development.md) - steps for getting this app running on your local machine - [content markup reference](./content-markup-reference.md) - how to use markup and features specific to the GitHub Docs site -- [content style guide](./content-style-guide) - style guidance specific to GitHub Docs content and additional resources for writing clear, helpful content +- [content style guide](./content-style-guide.md) - style guidance specific to GitHub Docs content and additional resources for writing clear, helpful content - [deployments](./deployments.md) - how our staging and production environments work - [liquid helpers](./liquid-helpers.md) - using liquid helpers for versioning in our docs - [localization checklist](./localization-checklist.md) - making sure your content is ready to be translated diff --git a/lib/all-products.js b/lib/all-products.js index 09e9d2070aae..b56dc4bee246 100644 --- a/lib/all-products.js +++ b/lib/all-products.js @@ -43,6 +43,12 @@ sortedProductIds.forEach(productId => { }) const externalProducts = { + cli: { + id: 'cli', + name: 'GitHub CLI', + href: 'https://cli.github.com/manual', + external: true + }, atom: { id: 'atom', name: 'Atom', diff --git a/middleware/robots.js b/middleware/robots.js index b50d8afe8e35..f36eaa833b0b 100644 --- a/middleware/robots.js +++ b/middleware/robots.js @@ -1,5 +1,6 @@ const languages = require('../lib/languages') const products = require('../lib/all-products') +const { deprecated } = require('../lib/enterprise-server-releases.js') let defaultResponse = 'User-agent: *' @@ -34,5 +35,13 @@ module.exports = function (req, res, next) { defaultResponse = defaultResponse.concat(`\nDisallow: /*${product.href}\nDisallow: /*/enterprise/*/user${product.href}`) }) + // Disallow crawling of Deprecated enterprise versions + deprecated + .forEach(version => { + defaultResponse = defaultResponse + .concat(`\nDisallow: /*/enterprise-server@${version}/*`) + .concat(`\nDisallow: /*/enterprise/${version}/*`) + }) + return res.send(defaultResponse) } diff --git a/tests/rendering/robots-txt.js b/tests/rendering/robots-txt.js index f070f0e0a80f..eb41c64e190b 100644 --- a/tests/rendering/robots-txt.js +++ b/tests/rendering/robots-txt.js @@ -89,4 +89,25 @@ describe('robots.txt', () => { expect(robots.isAllowed(`https://help.github.com/en/enterprise/${enterpriseServerReleases.latest}/user/actions`)).toBe(true) expect(robots.isAllowed(`https://help.github.com/en/enterprise/${enterpriseServerReleases.oldestSupported}/user/actions`)).toBe(true) }) + + it('disallows indexing of deprecated enterprise releases', async () => { + enterpriseServerReleases.deprecated.forEach(version => { + const blockedPaths = [ + // English + `https://help.github.com/en/enterprise-server@${version}/actions`, + `https://help.github.com/en/enterprise/${version}/actions`, + `https://help.github.com/en/enterprise-server@${version}/actions/overview`, + `https://help.github.com/en/enterprise/${version}/actions/overview`, + // Japanese + `https://help.github.com/ja/enterprise-server@${version}/actions`, + `https://help.github.com/ja/enterprise/${version}/actions`, + `https://help.github.com/ja/enterprise-server@${version}/actions/overview`, + `https://help.github.com/ja/enterprise/${version}/actions/overview` + ] + + blockedPaths.forEach(path => { + expect(robots.isAllowed(path)).toBe(false) + }) + }) + }) }) diff --git a/tests/rendering/sidebar.js b/tests/rendering/sidebar.js index 6b52dc39888c..34733ae80336 100644 --- a/tests/rendering/sidebar.js +++ b/tests/rendering/sidebar.js @@ -24,7 +24,8 @@ describe('sidebar', () => { expect($githubPage('.sidebar li.sidebar-product > a').text().trim()).toBe('GitHub.com') }) - test('includes links to external products like Atom and Electron', async () => { + test('includes links to external products like the CLI, Atom, and Electron', async () => { + expect($homePage('.sidebar a[href="https://cli.github.com/manual"]')).toHaveLength(1) expect($homePage('.sidebar a[href="https://atom.io/docs"]')).toHaveLength(1) expect($homePage('.sidebar a[href="https://electronjs.org/docs"]')).toHaveLength(1) })