Skip to content

Commit 426af8d

Browse files
authored
Merge branch 'github:main' into main
2 parents 856a33f + c662d80 commit 426af8d

File tree

2,226 files changed

+432534
-840109
lines changed

Some content is hidden

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

2,226 files changed

+432534
-840109
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/main/containers/javascript-node/.devcontainer/base.Dockerfile
1+
# To find available Node images, see https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
22

33
# [Choice] Node.js version
4-
ARG VARIANT="18-buster"
5-
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
4+
ARG VARIANT="dev-20-bullseye"
5+
FROM mcr.microsoft.com/devcontainers/javascript-node:${VARIANT}
66

77
# [Optional] Uncomment this section to install additional OS packages.
88
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"build": {
77
"dockerfile": "Dockerfile",
88
// Update 'VARIANT' to pick a Node version
9-
"args": { "VARIANT": "18" }
9+
"args": { "VARIANT": "20" }
1010
},
1111

1212
// Set *default* container specific settings.json values on container create.

.eslintrc.cjs

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/CODEOWNERS

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,4 @@ src/ghes-releases/lib/enterprise-dates.json @github/docs-content-enterprise
1414
content/actions/deployment/security-hardening-your-deployments/** @github/oidc
1515

1616
# RAI - CELA
17-
data/reusables/copilot/about-copilot-chat.md @github/legal-product
18-
content/copilot/github-copilot-in-the-cli/about-github-copilot-in-the-cli.md @github/legal-product
19-
20-
content/code-security/secret-scanning/about-the-regular-expression-generator-for-custom-patterns @github/legal-product
21-
data/reusables/secret-scanning/beta-custom-pattern-regular-expression-generator.md @github/legal-product
22-
23-
content/code-security/secret-scanning/about-the-detection-of-generic-secrets-with-secret-scanning.md @github/legal-product
24-
data/reusables/secret-scanning/generic-secret-detection-ai.md @github/legal-product
25-
26-
content/code-security/code-scanning/managing-code-scanning-alerts/about-autofix-for-codeql-code-scanning.md @github/legal-product
27-
data/reusables/rai/ @github/legal-product
28-
29-
content/copilot/github-copilot-enterprise/copilot-pull-request-summaries/about-copilot-pull-request-summaries.md @github/legal-product
17+
data/reusables/rai/** @github/legal-product
File renamed without changes.

CONTRIBUTING.md renamed to .github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Use the table of contents icon <img src="/contributing/images/table-of-contents.
1313
To get an overview of the project, read the [README](README.md) file. Here are some resources to help you get started with open source contributions:
1414

1515
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
16-
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
17-
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
16+
- [Set up Git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git)
17+
- [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow)
1818
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
1919

2020

2121
## Getting started
2222

23-
To navigate our codebase with confidence, see [the introduction to working in the docs repository](/contributing/working-in-docs-repository.md) :confetti_ball:. For more information on how we write our markdown files, see [the GitHub Markdown reference](contributing/content-markup-reference.md).
23+
To navigate our codebase with confidence, see [the introduction to working in the docs repository](/contributing/README.md) :confetti_ball:. For more information on how we write our markdown files, see "[Using Markdown and Liquid in GitHub Docs](https://docs.github.com/en/contributing/writing-for-github-docs/using-markdown-and-liquid-in-github-docs).
2424

2525
Check to see what [types of contributions](/contributing/types-of-contributions.md) we accept before making changes. Some of them don't even require writing a single line of code :sparkles:.
2626

@@ -32,7 +32,7 @@ If you spot a problem with the docs, [search if an issue already exists](https:/
3232

3333
#### Solve an issue
3434

35-
Scan through our [existing issues](https://github.com/github/docs/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See [Labels](/contributing/how-to-use-labels.md) for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix.
35+
Scan through our [existing issues](https://github.com/github/docs/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See "[Label reference](https://docs.github.com/en/contributing/collaborating-on-github-docs/label-reference)" for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix.
3636

3737
### Make Changes
3838

@@ -62,7 +62,7 @@ For more information about using a codespace for working on GitHub documentation
6262

6363
### Commit your update
6464

65-
Commit the changes once you are happy with them. Don't forget to [self-review](/contributing/self-review.md) to speed up the review process:zap:.
65+
Commit the changes once you are happy with them. Don't forget to use the "[Self review checklist](https://docs.github.com/en/contributing/collaborating-on-github-docs/self-review-checklist) to speed up the review process :zap:.
6666

6767
### Pull Request
6868

.github/ISSUE_TEMPLATE/improve-existing-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ body:
1818
label: Code of Conduct
1919
description: This project has a Code of Conduct that all participants are expected to understand and follow.
2020
options:
21-
- label: I have read and agree to the GitHub Docs project's [Code of Conduct](https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md)
21+
- label: I have read and agree to the GitHub Docs project's [Code of Conduct](https://github.com/github/docs/blob/main/.github/CODE_OF_CONDUCT.md)
2222
required: true
2323

2424
- type: textarea

.github/ISSUE_TEMPLATE/partner-contributed-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ body:
3939
required: true
4040
- label: MUST emphasize how the third-party product works with GitHub.
4141
required: true
42-
- label: MUST be written in Markdown format, using [one of the templates provided](contributing/github-partners/README.md#templates).
42+
- label: MUST be written in Markdown format, using [one of the templates provided](https://docs.github.com/en/contributing/writing-for-github-docs/templates).
4343
required: true
4444
- label: MUST include the name and URL of the GitHub technology partner responsible for maintenance of the documentation being contributed. This should be added via the `contributor.name` and `contributor.URL` properties in the template's YAML frontmatter.
4545
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If you made changes to the `content` directory, a table will populate in a comme
1616

1717
### Check off the following:
1818

19-
- [ ] I have reviewed my changes in staging, available via the **View deployment** link in this PR's timeline.
19+
- [ ] I have reviewed my changes in staging, available via the **View deployment** link in this PR's timeline (this link will be available after opening the PR).
2020

2121
- For content changes, you will also see an automatically generated comment with links directly to pages you've modified. The comment won't appear if your PR only edits files in the `data` directory.
22-
- [ ] For content changes, I have completed the [self-review checklist](https://github.com/github/docs/blob/main/contributing/self-review.md#self-review).
22+
- [ ] For content changes, I have completed the [self-review checklist](https://docs.github.com/en/contributing/collaborating-on-github-docs/self-review-checklist).
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Warmup pageinfo cache
2+
3+
description: Run this to create a .pageinfo-cache.json.br file
4+
5+
inputs:
6+
restore-only:
7+
description: Only attempt to restore, don't warm up
8+
required: false
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
# The caching technique here is to "unboundedly" add to the cache.
14+
# By unboundedly, it means the cached item will grow and grow.
15+
# The general idea is that we A) restore from cache, B) replace the
16+
# file by running the script, and C) save the file back to cache.
17+
# Optionally, you can have it just do A (and not B and C).
18+
19+
- name: Cache .pageinfo-cache.json.br (restore)
20+
# You can't use a SHA on these. Only possible with `actions/cache@SHA...`
21+
uses: actions/cache/restore@v3
22+
with:
23+
path: .pageinfo-cache.json.br
24+
key: pageinfo-cache-
25+
restore-keys: pageinfo-cache-
26+
27+
# When we use this composite action from the workflows like
28+
# Azure Preview Deploy and Azure Production Deploy, we don't have
29+
# any Node installed or any of its packages. I.e. we never
30+
# run `npm ci` in those actions. For security sake.
31+
# So we can't do things that require Node code.
32+
# Tests and others will omit the `restore-only` input, but
33+
# prepping for Docker build and push, will set it to a non-empty
34+
# string which basically means "If you can restore it, great.
35+
# If not, that's fine, don't bother".
36+
- name: Run script
37+
if: ${{ inputs.restore-only == '' }}
38+
shell: bash
39+
run: npm run precompute-pageinfo
40+
41+
- name: Cache .remotejson-cache (save)
42+
if: ${{ inputs.restore-only == '' }}
43+
uses: actions/cache/save@v3
44+
with:
45+
path: .pageinfo-cache.json.br
46+
key: pageinfo-cache-${{ github.sha }}

.github/actions/setup-elasticsearch/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Set up local Elasticsearch
22

3-
description: Install a local Elasticseach with version that matches prod
3+
description: Install a local Elasticsearch with version that matches prod
44

55
inputs:
66
token:

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ updates:
3030
schedule:
3131
interval: weekly
3232
day: thursday
33+
ignore:
34+
- dependency-name: 'node'

.github/workflows/auto-close-dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Auto Close Open Source Dependency Updates
77
# **Who does it impact**: It helps docs engineering focus on higher value work.
88

99
on:
10-
pull_request_target:
10+
pull_request:
1111
paths:
1212
- 'package*.json'
1313
- 'Gemfile*'
@@ -50,7 +50,7 @@ jobs:
5050
5151
# Because we get far too much spam ;_;
5252
- name: Lock conversations
53-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
53+
uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0
5454
env:
5555
PR_NUMBER: ${{ github.event.pull_request.number }}
5656
with:

.github/workflows/azure-preview-env-deploy.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
- if: ${{ env.IS_INTERNAL_BUILD == 'true' }}
117117
name: Determine which docs-early-access branch to clone
118118
id: 'check-early-access'
119-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
119+
uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0
120120
env:
121121
BRANCH_NAME: ${{ env.BRANCH_NAME }}
122122
with:
@@ -157,7 +157,7 @@ jobs:
157157
run: src/early-access/scripts/merge-early-access.sh
158158

159159
- name: Determine if we should include translations?
160-
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
160+
uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0
161161
id: with-translations
162162
with:
163163
script: |
@@ -192,13 +192,16 @@ jobs:
192192
rsync -rptovR ./user-code/content/./**/*.md ./content
193193
rsync -rptovR ./user-code/assets/./**/*.png ./assets
194194
rsync -rptovR ./user-code/data/./**/*.{yml,md} ./data
195-
rsync -rptovR ./user-code/components/./**/*.{scss,ts,tsx} ./components
196-
rsync -rptovR ./user-code/src/./**/*.tsx ./src
195+
rsync -rptovR ./user-code/src/./**/*.{scss,ts,tsx} ./src
197196
198197
- uses: ./.github/actions/warmup-remotejson-cache
199198
with:
200199
restore-only: true
201200

201+
- uses: ./.github/actions/precompute-pageinfo
202+
with:
203+
restore-only: true
204+
202205
# In addition to making the final image smaller, we also save time by not sending unnecessary files to the docker build context
203206
- name: 'Prune for preview env'
204207
run: src/workflows/prune-for-preview-env.sh
@@ -229,7 +232,7 @@ jobs:
229232
with:
230233
resourceGroupName: ${{ secrets.PREVIEW_ENV_RESOURCE_GROUP }}
231234
subscriptionId: ${{ secrets.NONPROD_SUBSCRIPTION_ID }}
232-
template: ./azure-preview-env-template.json
235+
template: ./src/workflows/azure-preview-env-template.json
233236
deploymentName: ${{ env.DEPLOYMENT_NAME }}
234237
parameters: appName="${{ env.APP_NAME }}"
235238
containerImage="${{ env.DOCKER_IMAGE }}"

.github/workflows/azure-preview-env-destroy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ name: Azure - Destroy Preview Env
55
# **Who does it impact**: All contributors.
66

77
on:
8+
# Required in lieu of `pull_request` so that PRs created from forks can destroy the preview environment.
89
pull_request_target:
910
types:
1011
- closed

.github/workflows/azure-prod-build-deploy.yml

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
env:
3232
DOCKER_IMAGE: ${{ secrets.PROD_REGISTRY_SERVER }}/${{ github.repository }}:${{ github.sha }}
3333
DOCKER_IMAGE_CACHE_REF: ${{ secrets.PROD_REGISTRY_SERVER }}/${{ github.repository }}:main-production
34+
RESOURCE_GROUP_NAME: docs-prod
35+
APP_SERVICE_NAME: ghdocs-prod
36+
SLOT_NAME: canary
3437

3538
steps:
3639
- name: 'Az CLI login'
@@ -75,6 +78,10 @@ jobs:
7578
with:
7679
restore-only: true
7780

81+
- uses: ./.github/actions/precompute-pageinfo
82+
with:
83+
restore-only: true
84+
7885
- uses: ./.github/actions/clone-translations
7986
with:
8087
token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
@@ -93,58 +100,23 @@ jobs:
93100
94101
- name: 'Update docker-compose.prod.yaml template file'
95102
run: |
96-
sed 's|#{IMAGE}#|${{ env.DOCKER_IMAGE }}|g' docker-compose.prod.tmpl.yaml > docker-compose.prod.yaml
103+
sed 's|#{IMAGE}#|${{ env.DOCKER_IMAGE }}|g' src/workflows/docker-compose.prod.tmpl.yaml > docker-compose.prod.yaml
97104
98105
- name: 'Apply updated docker-compose.prod.yaml config to canary slot'
99106
run: |
100-
az webapp config container set --multicontainer-config-type COMPOSE --multicontainer-config-file docker-compose.prod.yaml --slot canary -n ghdocs-prod -g docs-prod
107+
az webapp config container set --multicontainer-config-type COMPOSE --multicontainer-config-file docker-compose.prod.yaml --slot ${{ env.SLOT_NAME }} -n ${{ env.APP_SERVICE_NAME }} -g ${{ env.RESOURCE_GROUP_NAME }}
101108
102109
# Watch canary slot instances to see when all the instances are ready
103110
- name: Check that canary slot is ready
104-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
105111
env:
106112
CHECK_INTERVAL: 10000
107-
with:
108-
script: |
109-
const { execSync } = require('child_process')
110-
111-
const getStatesForSlot = (slot) => {
112-
return JSON.parse(
113-
execSync(
114-
`az webapp list-instances --slot ${slot} --query "[].state" -n ghdocs-prod -g docs-prod`,
115-
{ encoding: 'utf8' }
116-
)
117-
)
118-
}
119-
120-
let hasStopped = false
121-
const waitDuration = parseInt(process.env.CHECK_INTERVAL, 10) || 10000
122-
async function doCheck() {
123-
const states = getStatesForSlot('canary')
124-
console.log(`Instance states:`, states)
125-
126-
// We must wait until at-least 1 instance has STOPPED to know we're looking at the "next" deployment and not the "previous" one
127-
// That way we don't immediately succeed just because all the previous instances were READY
128-
if (!hasStopped) {
129-
hasStopped = states.some((s) => s === 'STOPPED')
130-
}
131-
132-
const isAllReady = states.every((s) => s === 'READY')
133-
134-
if (hasStopped && isAllReady) {
135-
process.exit(0) // success
136-
}
137-
138-
console.log(`checking again in ${waitDuration}ms`)
139-
setTimeout(doCheck, waitDuration)
140-
}
141-
142-
doCheck()
143-
144-
# TODO - make a request to verify the canary app version aligns with *this* github action workflow commit sha
113+
EXPECTED_SHA: ${{ github.sha }}
114+
CANARY_BUILD_URL: https://ghdocs-prod-canary.azurewebsites.net/_build
115+
run: src/workflows/check-canary-slots.js
116+
145117
- name: 'Swap canary slot to production'
146118
run: |
147-
az webapp deployment slot swap --slot canary --target-slot production -n ghdocs-prod -g docs-prod
119+
az webapp deployment slot swap --slot ${{ env.SLOT_NAME }} --target-slot production -n ${{ env.APP_SERVICE_NAME }} -g ${{ env.RESOURCE_GROUP_NAME }}
148120
149121
- uses: ./.github/actions/slack-alert
150122
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}

0 commit comments

Comments
 (0)