Skip to content

Commit

Permalink
Merge branch 'main' into pwsh-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Lopes authored Mar 7, 2022
2 parents 9f05f69 + 8af7390 commit fbcc8f4
Show file tree
Hide file tree
Showing 1,701 changed files with 37,174 additions and 37,993 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ The day after a GHES version's [deprecation date](https://github.com/github/docs

- [ ] In your checkout of the [repo with archived GHES content](https://github.com/github/help-docs-archived-enterprise-versions), create a new branch: `git checkout -b deprecate-<version>`
- [ ] In your `docs-internal` checkout, download the static files for the oldest supported version into your archival checkout:
The archive script depends on an optional dependency so install optional dependencies first:
```
$ npm ci --include-optional
```
Then run the archive script:
```
$ script/enterprise-server-deprecations/archive-version.js -p <path-to-archive-repo-checkout>
```
Expand All @@ -26,52 +31,50 @@ The day after a GHES version's [deprecation date](https://github.com/github/docs
## Step 2: Upload the assets directory to Azure storage
- [ ] Log in to the Azure portal from Okta. Navigate to the [githubdocs Azure Storage Blob resoruce](https://portal.azure.com/#@githubazure.onmicrosoft.com/resource/subscriptions/fa6134a7-f27e-4972-8e9f-0cedffa328f1/resourceGroups/docs-production/providers/Microsoft.Storage/storageAccounts/githubdocs/overview).
- [ ] Log in to the Azure portal from Okta. Navigate to the [githubdocs Azure Storage Blob resource](https://portal.azure.com/#@githubazure.onmicrosoft.com/resource/subscriptions/fa6134a7-f27e-4972-8e9f-0cedffa328f1/resourceGroups/docs-production/providers/Microsoft.Storage/storageAccounts/githubdocs/overview).
- [ ] Click the "Open in Explorer" button to the right of search box.If you haven't already, click the download link to download "Microsoft Azure Storage Explorer." To login to the app, click the plug icon in the left sidebar and click the option to "add an azure account." When you login, you'll need a yubikey to authenticate through Okta.
- [ ] From the Microsoft Azure Storage Explorer app, select the `githubdocs` storage account resource and navigate to the `github-images` blob container.
- [ ] Click "Upload" and select "Upload folder." Click the "Selected folder" input to navigate to the `help-docs-archived-enterprise-versions` repository and select the `assets` directory for the version you just generated. In the "Destination folder" input, add the version number. For example, `/enterprise/2.22/`.
- [ ] Check the log to ensure all files were uploaded successfully.
- [ ] Removed the `assets` directory from the `/help-docsc-archived-enterprise-versions` repository.
- [ ] Remove the `assets` directory from your `help-docsc-archived-enterprise-versions` repository, we don't want to commit that directory in the next step.
## Step 3: Commit and push changes to help-docs-archived-enterprise-versions repo
- [ ] Search for `site-search-input` in the compressed Javascript files. When you find it, use something like https://beautifier.io/ to reformat it to be readable. Find `site-search-input` in the file, there will be something like... `1125: function () { return [SearchReactComponent] },` Delete the innards of this function, but leave the `function() {}` part.
- [ ] Search for `site-search-input` in the compressed Javascript files (should find the file in the `_next` directory). When you find it, use something like https://beautifier.io/ to reformat it to be readable. Find `site-search-input` in the file, the result will be enclosed in a function that looks something like... `1125: function () { ... },` Delete the innards of this function, but leave the `function() {}` part.
- [ ] Copy, paste, and save the updated file back into your local `help-docs-archived-enterprise-versions` repository.
- [ ] In your archival checkout, `git add <version>`, commit, and push.
- [ ] Open a PR and merge it in. Note that the version will _not_ be deprecated on the docs site until you do the next step.
## Step 4: Deprecate the version in docs-internal
In your `docs-internal` checkout:
- [ ] Create a new branch: `git checkout -b deprecate-<version>`.
- [ ] Edit `lib/enterprise-server-releases.js` by moving the number to be deprecated into the `deprecated` array.
- [ ] Edit `lib/enterprise-server-releases.js` by removing the version number to be deprecated from the `supported` array and move it to the `deprecated` array.
- [ ] Open a new PR. Make sure to check the following:
- [ ] Tests are passing.
- [ ] The deprecated version renders on staging as expected. You should be able to navigate to docs.github.com/enterprise/<DEPRECATED VERSION> to access the docs. You should also be able to navigate to a page that is available in the deprecated version and change the version in the URL to the deprecated version, to test redirects.
- [ ] Tests are passing (you may need to include the changes in step 6 to get tests to pass).
- [ ] The deprecated version renders in preview as expected. You should be able to navigate to `docs.github.com/enterprise/<DEPRECATED VERSION>` to access the docs. You should also be able to navigate to a page that is available in the deprecated version and change the version in the URL to the deprecated version, to test redirects.
- [ ] The new oldest supported version renders on staging as expected. You should see a banner on the top of every page for the oldest supported version that notes when the version will be deprecated.
You may need to include the changes in step 6 to get tests to pass.
## Step 5: Remove static files for the version
- [ ] In your `docs-internal` checkout, from your `remove-<version>-static-files` branch: `git checkout -b remove-<version>-static-files`
- [ ] In your `docs-internal` checkout, create a new branch `remove-<version>-static-files` branch: `git checkout -b remove-<version>-static-files` (you can branch off of `main` or from your `deprecate-<version>` branch, up to you).
- [ ] Run `script/enterprise-server-deprecations/remove-static-files.js` and commit results.
- [ ] Run `script/enterprise-server-deprecations/remove-redirects.js` and commit results.
- [ ] `lib/rest/static` directory has deferenced and decorated directory underneath, remove the numbered version and all below from the list
- [ ] Open a new PR.
- [ ] Get a review from docs-engineering and merge. This step can be merged independently from step 6. The purpose of splitting up steps 5 and 6 is to focus the review on specific files.
## Step 6: Remove the liquid conditionals and content for the version
- [ ] In your `docs-internal` checkout, from your `remove-<version>-markup` branch: `git checkout -b remove-<version>-markup`
- [ ] In your `docs-internal` checkout, create a new branch `remove-<version>-markup` branch: `git checkout -b remove-<version>-markup` (you can branch off of `main` or from your `deprecate-<version>` branch, up to you).
- [ ] Remove the outdated Liquid markup and frontmatter.
- [ ] Run the script: `script/enterprise-server-deprecations/remove-version-markup.js --release <number>`.
- [ ] Spot check a few changes. Content, frontmatter, and data files should all have been updated.
- [ ] Open a PR with the results. The diff may be large and complex, so make sure to get a review from `@github/docs-content`.
- [ ] Debug any test failures or unexpected results.
- [ ] Debug any test failures or unexpected results -- it's very likely manual updates will be necessary, the script does a lot of work but doesn't automate everything and can't 100% replace human intent.
- [ ] When the PR is approved, merge it in to complete the deprecation. This can be merged independently from step 5.
## Step 7: Deprecate the OpenAPI description in `github/github`
- [ ] In `github/github`, edit the release's config file in `app/api/description/config/releases/`, and change `deprecated: false` to `deprecated: true`.
- [ ] Open a new PR, and get the required code owner approvals. A docs-content team member can approve it for the docs team.
- [ ] When the PR is approved, merge the `github/github` PR.
- [ ] When the PR is approved, [deploy the `github/github` PR](https://thehub.github.com/engineering/devops/deployment/deploying-dotcom/). If you haven't deployed a `github/github` PR before, work with someone that has -- the process isn't too involved depending on how you deploy, but there are a lot of details that can potentially be confusing as you can see from the documentation.
Binary file removed assets/images/help/repository/copy-link-button.png
Binary file not shown.
Binary file not shown.
Binary file removed assets/images/help/repository/workflow-job.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions components/article/ClientSideHighlightJS.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { useEffect } from 'react'
import { useRouter } from 'next/router'
import hljs from 'highlight.js/lib/core'
import json from 'highlight.js/lib/languages/json'
import javascript from 'highlight.js/lib/languages/javascript'
import hljsCurl from 'highlightjs-curl'

// Add as needed. It's pretty cheap to add but please don't use
// highlight.js import that loads all and everything.
hljs.registerLanguage('json', json)
const SUPPORTED_LANGUAGES = ['json']
hljs.registerLanguage('javascript', javascript)
hljs.registerLanguage('curl', hljsCurl)
const SUPPORTED_LANGUAGES = ['json', 'javascript', 'curl']

// This is the selector we use for the first document.querySelectorAll()
// to find the containers for `<code>` tags. Because it's s dataset
Expand All @@ -24,6 +29,8 @@ const CODE_ELEMENTS_PARENT_SELECTOR = '[data-highlight]'
const CODE_SELECTOR = 'pre code'

export default function ClientSideHighlightJS() {
const { asPath } = useRouter()

useEffect(() => {
// Hi Internet Explorer!
// https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#browser_compatibility
Expand Down Expand Up @@ -59,7 +66,7 @@ export default function ClientSideHighlightJS() {
intersectionObserver.observe(element)
}
}
}, [])
}, [asPath])

return null
}
2 changes: 2 additions & 0 deletions components/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ declare module '*.scss' {
const content: Record<string, string>
export default content
}

declare module 'highlightjs-curl'
13 changes: 4 additions & 9 deletions components/rest/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ import styles from './CodeBlock.module.scss'
type Props = {
verb?: string
codeBlock: string
setHTML?: boolean
highlight?: string
}

export function CodeBlock({ verb, codeBlock, setHTML = false }: Props) {
return setHTML ? (
<div
className={cx(styles.codeBlock, 'rounded')}
dangerouslySetInnerHTML={{ __html: codeBlock }}
/>
) : (
<pre className={cx(styles.methodCodeBlock, 'rounded-1 border')}>
export function CodeBlock({ verb, codeBlock, highlight }: Props) {
return (
<pre className={cx(styles.methodCodeBlock, 'rounded-1 border')} data-highlight={highlight}>
<code>
{verb && (
<span className="color-bg-accent-emphasis color-fg-on-emphasis rounded-1 text-uppercase">
Expand Down
6 changes: 3 additions & 3 deletions components/rest/RestCodeSamples.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { xCodeSample } from './types'
import type { xCodeSample } from './types'
import { useTranslation } from 'components/hooks/useTranslation'
import { CodeBlock } from './CodeBlock'

Expand Down Expand Up @@ -34,8 +34,8 @@ export function RestCodeSamples({ slug, xCodeSamples }: Props) {
sampleElements.push(
<CodeBlock
key={sample.lang + index}
codeBlock={sample.sourceHTML}
setHTML={true}
codeBlock={sample.source}
highlight={sample.lang === 'JavaScript' ? 'javascript' : 'curl'}
></CodeBlock>
)
}
Expand Down
2 changes: 1 addition & 1 deletion components/rest/RestResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function RestResponse({ responses }: Props) {
<CodeBlock
codeBlock={`Status: ${response.httpStatusCode} ${response.httpStatusMessage}`}
/>
<CodeBlock codeBlock={response.payload} setHTML={true} />
{response.payload ? <CodeBlock codeBlock={response.payload} highlight="json" /> : null}
</div>
)
})}
Expand Down
2 changes: 1 addition & 1 deletion components/rest/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface CodeResponse {

export interface xCodeSample {
lang: string
sourceHTML: string
source: string
}

export interface Preview {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ topics:
shortTitle: Share with your enterprise
---

{% note %}

**Note:** Allowing workflows to access actions in internal repositories is currently in beta and subject to change.

{% endnote %}

## About {% data variables.product.prodname_actions %} access to internal repositories

If your organization is owned by an enterprise account, you can share actions and workflows within your enterprise, without publishing the action or workflow publicly, by allowing {% data variables.product.prodname_actions %} workflows to access an internal repository that contains the action or workflow.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ You can configure a subject that filters for a specific [environment](/actions/d

#### Filtering for `pull_request` events

The subject claim includes the `pull_request` string when the workflow is triggered by a pull request event.
The subject claim includes the `pull_request` string when the workflow is triggered by a pull request event, but only if the job doesn't reference an environment.

You can configure a subject that filters for the [`pull_request`](/actions/learn-github-actions/events-that-trigger-workflows#pull_request) event. In this example, the workflow run must have been triggered by a `pull_request` event in a repository named `octo-repo` that is owned by the `octo-org` organization:

Expand Down
3 changes: 2 additions & 1 deletion content/actions/guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ learningTracks:
- continuous_integration
- continuous_deployment
- deploy_to_the_cloud
- '{% ifversion ghec or ghes or ghae %}adopting_github_actions_for_your_enterprise{% endif %}'
- adopting_github_actions_for_your_enterprise_ghec
- adopting_github_actions_for_your_enterprise_ghes_and_ghae
- hosting_your_own_runners
- create_actions
includeGuides:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ versions:
type: overview
---

{% data reusables.actions.ae-self-hosted-runners-notice %}
{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}

## About self-hosted runners

{% data reusables.actions.self-hosted-runner-description %} Self-hosted runners can be physical, virtual, in a container, on-premises, or in a cloud.
A self-hosted runner is a system that you deploy and manage to execute jobs from {% data variables.product.prodname_actions %} on {% ifversion ghae or ghec %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}. For more information about {% data variables.product.prodname_actions %}, see "[Understanding {% data variables.product.prodname_actions %}](/actions/learn-github-actions/understanding-github-actions){% ifversion fpt %}."{% elsif ghec or ghes or ghae %}" and "[About {% data variables.product.prodname_actions %} for enterprises](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises)."{% endif %}

{% data reusables.actions.self-hosted-runner-description %} {% data reusables.actions.self-hosted-runner-locations %}

{% data reusables.actions.self-hosted-runner-architecture %} {% data reusables.actions.runner-app-open-source %} When a new version is released, the runner application automatically updates itself when a job is assigned to the runner, or within a week of release if the runner hasn't been assigned any jobs.

You can add self-hosted runners at various levels in the management hierarchy:
- Repository-level runners are dedicated to a single repository.
Expand Down Expand Up @@ -59,7 +62,7 @@ You can use any machine as a self-hosted runner as long at it meets these requir
* The machine has enough hardware resources for the type of workflows you plan to run. The self-hosted runner application itself only requires minimal resources.
* If you want to run workflows that use Docker container actions or service containers, you must use a Linux machine and Docker must be installed.

{% ifversion fpt or ghes > 3.2 or ghec %}
{% ifversion fpt or ghes > 3.2 or ghec or ghae-issue-4462 %}
## Autoscaling your self-hosted runners

You can automatically increase or decrease the number of self-hosted runners in your environment in response to the webhook events you receive. For more information, see "[Autoscaling with self-hosted runners](/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners)."
Expand Down Expand Up @@ -133,12 +136,7 @@ The self-hosted runner polls {% data variables.product.product_name %} to retrie

{% data reusables.actions.self-hosted-runner-ports-protocols %}

{% ifversion ghae %}
You must ensure that the self-hosted runner has appropriate network access to communicate with the {% data variables.product.prodname_ghe_managed %} URL and its subdomains.
For example, if your instance name is `octoghae`, then you will need to allow the self-hosted runner to access `octoghae.githubenterprise.com`, `api.octoghae.githubenterprise.com`, and `codeload.octoghae.githubenterprise.com`.

If you use an IP address allow list for your {% data variables.product.prodname_dotcom %} organization or enterprise account, you must add your self-hosted runner's IP address to the allow list. For more information, see "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization#using-github-actions-with-an-ip-allow-list)."
{% endif %}
{% data reusables.actions.self-hosted-runner-communications-for-ghae %}

{% ifversion fpt or ghec %}

Expand Down Expand Up @@ -242,3 +240,11 @@ Untrusted workflows running on your self-hosted runner pose significant security
* Persisting unwanted or dangerous data on the machine.

For more information about security hardening for self-hosted runners, see "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#hardening-for-self-hosted-runners)."

{% ifversion ghec or ghes or ghae %}

## Further reading

- "[Getting started with self-hosted runners for your enterprise](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-self-hosted-runners-for-your-enterprise)"

{% endif %}
Loading

0 comments on commit fbcc8f4

Please sign in to comment.