Skip to content

Commit bf6c303

Browse files
authored
Merge branch 'main' into patch-2
2 parents 9f3515b + 7f4d44a commit bf6c303

File tree

587 files changed

+7548
-7131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

587 files changed

+7548
-7131
lines changed

.github/workflows/hubber-contribution-help.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: |
4242
gh pr comment $PR --body "Thanks so much for opening this PR and contributing to GitHub Docs!
4343
44-
- When you're ready for the Docs team to review this PR, add the *ready-for-doc-review* label to your PR to the [Docs Content review board](https://github.com/orgs/github/memexes/901?layout=table&groupedBy%5BcolumnId%5D=11024). **Please factor in at least 72 hours for a review, even longer if this is a substantial change.**
44+
- When you're ready for the Docs team to review this PR, add the *ready-for-doc-review* label to your PR, and it will be automatically added to the [Docs Content review board](https://github.com/orgs/github/memexes/901?layout=table&groupedBy%5BcolumnId%5D=11024). **Please factor in at least 72 hours for a review, even longer if this is a substantial change.**
4545
- If this is a major update to the docs, you might want to go back and open an [issue](https://github.com/github/docs-content/issues/new/choose) to ensure we've covered all areas of the docs in these updates. Not doing so may result in delays or inaccurate documentation."
4646
env:
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-16.3 KB
Loading
68.4 KB
Loading
-2.6 KB
Loading
20.6 KB
Loading
23.8 KB
Loading

components/article/ClientsideRedirectExceptions.tsx

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,67 @@
11
import { useEffect } from 'react'
22
import { useRouter } from 'next/router'
33

4-
import restApiOverrides from '../../lib/redirects/static/client-side-rest-api-redirects.json'
5-
import productOverrides from '../../lib/redirects/static/client-side-product-redirects.json'
6-
const overrideRedirects: Record<string, string> = { ...restApiOverrides, ...productOverrides }
7-
4+
// We recently moved several rest api operations around
5+
// in the docs. That means that we are out of sync with
6+
// the urls defined in the OpenAPI. We will eventually
7+
// update those urls but for now we want to ensure that
8+
// we have client-side redirects in place for any urls
9+
// in the product that link to the rest docs (e.g., error
10+
// code urls from the apis).
11+
// The client-side redirects can consist of operation urls
12+
// being redirected to the new operation url or headings
13+
// on a page that need to be redirected to the new page (e.g.,
14+
// /rest/reference/repos#statuses to
15+
// /rest/reference/commits#commit-statuses)
816
export default function ClientSideRedirectExceptions() {
917
const router = useRouter()
1018
useEffect(() => {
11-
// We have some one-off redirects for rest api docs
12-
// currently those are limited to the repos page, but
13-
// that will grow soon as we restructure the rest api docs.
14-
// This is a workaround to updating the hardcoded links
15-
// directly in the REST API code in a separate repo, which
16-
// requires many file changes and teams to sign off.
17-
// While the organization is turbulent, we can do this.
18-
// Once it's more settled, we can refactor the rest api code
19-
// to leverage the OpenAPI urls rather than hardcoded urls.
20-
const { hash, pathname } = window.location
19+
// Because we have an async call to fetch, it's possible that this
20+
// component unmounts before we perform the redirect, however, React
21+
// will still try to perform the redirect even after the component
22+
// is unmounted. To prevent this, we can use the AbortController signal
23+
// to abort the Web request when the component unmounts.
24+
const controller = new AbortController()
25+
const signal = controller.signal
2126

22-
// The `hash` will start with a `#` but all the keys in
23-
// `overrideRedirects` do not. Hence, this slice.
24-
const combined = pathname + hash
25-
const overrideKey = combined
27+
const { hash, pathname } = window.location
28+
// path without a version or language
29+
const barePath = pathname
2630
.replace(`/${router.locale}`, '')
2731
.replace(`/${router.query.versionId || ''}`, '')
28-
const redirectToName = overrideRedirects[overrideKey]
29-
if (redirectToName) {
30-
const newPathname = combined.replace(overrideKey, redirectToName)
31-
router.replace(newPathname)
32+
33+
async function getRedirect() {
34+
try {
35+
const sp = new URLSearchParams()
36+
sp.set('path', barePath)
37+
sp.set('hash', hash.replace(/^#/, ''))
38+
39+
// call the anchor-redirect endpoint to get the redirect url
40+
const response = await fetch(`/anchor-redirect?${sp.toString()}`, {
41+
signal,
42+
})
43+
44+
// the response status will always be 200 unless there
45+
// was a problem with the fetch request. When the
46+
// redirect doesn't exist the json response will be empty
47+
if (response.ok) {
48+
const { to } = await response.json()
49+
if (to) {
50+
// we want to redirect with the language and version in tact
51+
// so we'll replace the full url's path and hash
52+
const fromUrl = pathname + hash
53+
const bareUrl = barePath + hash
54+
const toUrl = fromUrl.replace(bareUrl, to)
55+
router.replace(toUrl)
56+
}
57+
}
58+
} catch (error) {
59+
console.warn('Unable to fetch client-side redirect:', error)
60+
}
3261
}
62+
getRedirect()
63+
64+
return () => controller.abort()
3365
}, [])
3466

3567
return null

content/admin/code-security/managing-github-advanced-security-for-your-enterprise/deploying-github-advanced-security-in-your-enterprise.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ When code scanning identifies a problem in a pull request, you can review the hi
253253
code and resolve the alert. For more information, see "[Triaging {% data variables.product.prodname_code_scanning %} alerts in pull requests](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/triaging-code-scanning-alerts-in-pull-requests)."
254254

255255
If you have write permission to a repository you can manage code scanning alerts for that
256-
repository. With write permission to a repository, you can view, fix, dismiss, or delete alerts for potential
257-
vulnerabilities or errors in your repository's code. For more information, see "[Managing code scanning alerts for your repository](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository)."
256+
repository. With write permission to a repository, {% if delete-code-scanning-alerts %}you can view, fix, dismiss, or delete alerts {% else %}you can view, fix, or dismiss alerts{% endif %} for potential vulnerabilities or errors in your repository's code. For more information, see "[Managing code scanning alerts for your repository](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository)."
258257

259258
#### Generate reports of {% data variables.product.prodname_code_scanning %} alerts
260259

content/admin/github-actions/enabling-github-actions-for-github-enterprise-server/enabling-github-actions-with-minio-gateway-for-nas-storage.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ redirect_from:
1414
- /admin/github-actions/enabling-github-actions-with-minio-gateway-for-nas-storage
1515
shortTitle: MinIO Gateway for NAS storage
1616
---
17-
## Prerequisites
1817

19-
{% data reusables.actions.enterprise-s3-support-warning %}
18+
{% warning %}
19+
20+
**Warning**: MinIO has announced removal of MinIO Gateways. Starting June 1st, 2022, support and bug fixes for the current MinIO NAS Gateway implementation will only be available for paid customers via their LTS support contract. If you want to continue using MinIO Gateways with {% data variables.product.prodname_actions %}, we recommend moving to MinIO LTS support. For more information, see [Scheduled removal of MinIO Gateway for GCS, Azure, HDFS](https://github.com/minio/minio/issues/14331) in the minio/minio repository.
21+
22+
{% endwarning %}
23+
24+
## Prerequisites
2025

2126
Before enabling {% data variables.product.prodname_actions %}, make sure you have completed the following steps:
2227

content/admin/github-actions/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Each action is a repository in the `actions` organization, and each action repos
4848

4949
**Notes:**
5050
- When using setup actions (such as `actions/setup-LANGUAGE`) on {% data variables.product.product_name %} with self-hosted runners, you might need to set up the tools cache on runners that do not have internet access. For more information, see "[Setting up the tool cache on self-hosted runners without internet access](/enterprise/admin/github-actions/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access)."
51-
- Upgrades to {% data variables.product.product_name %} will not result in the bundled actions being updated.
51+
- Bundled actions are automatically updated when {% data variables.product.product_name %} is updated.
5252

5353
{% endnote %}
5454

0 commit comments

Comments
 (0)