Skip to content

Commit 2220b6c

Browse files
authored
Merge branch 'main' into patch-1
2 parents d49ccb0 + c844b94 commit 2220b6c

File tree

3,244 files changed

+1755311
-149378
lines changed

Some content is hidden

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

3,244 files changed

+1755311
-149378
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.eslintrc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es2020: true,
6+
node: true
7+
},
8+
parser: 'babel-eslint',
9+
extends: [
10+
'eslint:recommended',
11+
'standard'
12+
],
13+
parserOptions: {
14+
ecmaVersion: 11
15+
},
16+
rules: {
17+
},
18+
overrides: [
19+
{
20+
files: [
21+
'**/tests/**/*.js'
22+
],
23+
env: {
24+
jest: true
25+
}
26+
}
27+
]
28+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ Thanks again!
2222

2323
### Check off the following:
2424
- [ ] All of the tests are passing.
25-
- [ ] I have reviewed my changes in staging.
25+
- [ ] I have reviewed my changes in staging. (look for the **deploy-to-heroku** link in your pull request, then click **View deployment**)
2626
- [ ] For content changes, I have reviewed the [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md)
2727
- [ ] 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).
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env node
2+
3+
const fs = require('fs')
4+
const core = require('@actions/core')
5+
const eventPayload = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'))
6+
7+
// This workflow-run script does the following:
8+
// 1. Gets an array of labels on a PR.
9+
// 2. Finds one with the relevant Algolia text; if none found, exits early.
10+
// 3. Gets the version substring from the label string.
11+
12+
const labelText = 'sync-english-index-for-'
13+
const labelsArray = eventPayload.pull_request.labels
14+
15+
// Exit early if no labels are on this PR
16+
if (!(labelsArray && labelsArray.length)) {
17+
process.exit(0)
18+
}
19+
20+
// Find the relevant label
21+
const algoliaLabel = labelsArray
22+
.map(label => label.name)
23+
.find(label => label.startsWith(labelText))
24+
25+
// Exit early if no relevant label is found
26+
if (!algoliaLabel) {
27+
process.exit(0)
28+
}
29+
30+
31+
// Returns: [email protected]
32+
const versionToSync = algoliaLabel.split(labelText)[1]
33+
34+
// Store the version so we can access it later in the workflow
35+
core.setOutput('versionToSync', versionToSync)
36+
process.exit(0)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env node
2+
3+
const fs = require('fs')
4+
const path = require('path')
5+
const { execSync } = require('child_process')
6+
const semver = require('semver')
7+
8+
/*
9+
* This script performs two checks to prevent shipping development mode OpenAPI schemas:
10+
* - Ensures the `info.version` property is a semantic version.
11+
* In development mode, the `info.version` property is a string
12+
* containing the `github/github` branch name.
13+
* - Ensures the decorated schema matches the dereferenced schema.
14+
* The workflow that calls this script runs `script/rest/update-files.js`
15+
* with the `--decorate-only` switch then checks to see if files changed.
16+
*
17+
*/
18+
19+
// Check that the `info.version` property is a semantic version
20+
const dereferencedDir = path.join(process.cwd(), 'lib/rest/static/dereferenced')
21+
const schemas = fs.readdirSync(dereferencedDir)
22+
schemas.forEach(filename => {
23+
const schema = require(path.join(dereferencedDir, filename))
24+
if (!semver.valid(schema.info.version)) {
25+
console.log(`🚧⚠️ Your branch contains a development mode OpenAPI schema: ${schema.info.version}. This check is a reminder to not 🚢 OpenAPI files in development mode. 🛑`)
26+
process.exit(1)
27+
}
28+
})
29+
30+
// Check that the decorated schema matches the dereferenced schema
31+
const changedFiles = execSync('git diff --name-only HEAD').toString()
32+
33+
if(changedFiles !== '') {
34+
console.log(`These files were changed:\n${changedFiles}`)
35+
console.log(`🚧⚠️ Your decorated and dereferenced schema files don't match. Ensure you're using decorated and dereferenced schemas from the automatically created pull requests by the 'github-openapi-bot' user. For more information, see 'script/rest/README.md'. 🛑`)
36+
process.exit(1)
37+
}
38+
39+
// All checks pass, ready to ship
40+
console.log('All good 👍')
41+
process.exit(0)

.github/allowed-actions.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ module.exports = [
2121
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
2222
'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b',
2323
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
24+
'lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8',
2425
'pascalgn/automerge-action@c9bd182',
25-
'peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5',
26+
'peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326',
27+
'peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd',
2628
'peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8',
2729
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
2830
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
2931
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
3032
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
3133
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
32-
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0'
34+
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0',
35+
'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575'
3336
]
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
name: 60 Days Stale Check
22
on:
33
schedule:
4-
- cron: "40 16 * * *" # Run each day at 16:40 UTC / 8:40 PST
4+
- cron: '40 16 * * *' # Run each day at 16:40 UTC / 8:40 PST
55

66
jobs:
77
stale:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
11-
with:
12-
repo-token: ${{ secrets.GITHUB_TOKEN }}
13-
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
14-
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.'
15-
days-before-stale: 60
16-
days-before-close: -1
17-
only-labels: 'engineering'
18-
stale-issue-label: 'stale'
19-
stale-pr-label: 'stale'
20-
10+
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
14+
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.'
15+
days-before-stale: 60
16+
days-before-close: -1
17+
only-labels: 'engineering'
18+
stale-issue-label: 'stale'
19+
stale-pr-label: 'stale'
20+
exempt-pr-labels: 'never-stale'
21+
exempt-issue-labels: 'never-stale'

.github/workflows/auto-label-prs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Auto label Pull Requests
22
on:
3-
- pull_request
3+
pull_request:
44

55
jobs:
66
triage:
77
if: github.repository == 'github/docs-internal'
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb
11-
with:
12-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
10+
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb
11+
with:
12+
repo-token: '${{ secrets.GITHUB_TOKEN }}'

.github/workflows/automerge-dependencies.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Auto Merge Dependency Updates
33
on:
44
pull_request:
55
paths:
6-
- "package*.json"
7-
- "Gemfile*"
8-
- "Dockerfile"
9-
- ".github/workflows/**"
6+
- 'package*.json'
7+
- 'Gemfile*'
8+
- 'Dockerfile'
9+
- '.github/workflows/**'
1010
pull_request_review:
1111
types:
1212
- edited

.github/workflows/automerge.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
if: contains(github.event.pull_request.labels.*.name, 'automerge') || contains(github.event.pull_request.labels.*.name, 'autosquash')
2424
steps:
2525
- name: automerge
26-
uses: "pascalgn/automerge-action@c9bd182"
26+
uses: 'pascalgn/automerge-action@c9bd182'
2727
env:
28-
GITHUB_TOKEN: "${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}"
29-
MERGE_METHOD_LABELS: "automerge=merge,autosquash=squash"
30-
MERGE_COMMIT_MESSAGE: "pull-request-title"
31-
MERGE_METHOD: "merge"
32-
MERGE_FORKS: "true"
33-
MERGE_RETRIES: "50"
34-
MERGE_RETRY_SLEEP: "10000" # ten seconds
35-
UPDATE_LABELS: "automerge,autosquash"
36-
UPDATE_METHOD: "merge"
28+
GITHUB_TOKEN: '${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}'
29+
MERGE_METHOD_LABELS: 'automerge=merge,autosquash=squash'
30+
MERGE_COMMIT_MESSAGE: 'pull-request-title'
31+
MERGE_METHOD: 'merge'
32+
MERGE_FORKS: 'true'
33+
MERGE_RETRIES: '50'
34+
MERGE_RETRY_SLEEP: '10000' # ten seconds
35+
UPDATE_LABELS: 'automerge,autosquash'
36+
UPDATE_METHOD: 'merge'

.github/workflows/browser-test.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@ jobs:
2020
paths: '[".github/workflows/browser-test.yml","assets/**", "content/**", "data/**", "includes/**", "javascripts/**", "jest-puppeteer.config.js", "jest.config.js", "layouts/**", "lib/**", "middleware/**", "package-lock.json", "package.json", "server.js", "translations/**", "webpack.config.js"]'
2121
build:
2222
needs: see_if_should_skip
23-
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
2423
runs-on: ubuntu-latest
2524
steps:
26-
- name: Checkout
25+
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
26+
# Even if if doesn't do anything
27+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
28+
name: Checkout
2729
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
2830

29-
- name: Install
31+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
32+
name: Install
3033
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
3134
with:
3235
args: npm ci
3336

34-
- name: Test
37+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
38+
name: Test
3539
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
3640
with:
3741
args: npm run browser-test

.github/workflows/check-all-english-links.yml

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,46 @@ name: Check all English links
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "40 19 * * *" # once a day at 19:40 UTC / 11:40 PST
6+
- cron: '40 19 * * *' # once a day at 19:40 UTC / 11:40 PST
77

88
jobs:
99
check_all_english_links:
1010
name: Check all links
1111
if: github.repository == 'github/docs-internal'
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
15-
- name: npm ci
16-
run: npm ci
17-
- name: npm run build
18-
run: npm run build
19-
- name: Run script
20-
run: script/check-english-links.js > broken_links.md
21-
- if: ${{ failure() }}
22-
name: Get title for issue
23-
id: check
24-
run: echo "::set-output name=title::$(head -1 broken_links.md)"
25-
- if: ${{ failure() }}
26-
name: Create issue from file
27-
uses: peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5
28-
with:
29-
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
30-
title: ${{ steps.check.outputs.title }}
31-
content-filepath: ./broken_links.md
32-
labels: broken link report
14+
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
15+
- name: npm ci
16+
run: npm ci
17+
- name: npm run build
18+
run: npm run build
19+
- name: Run script
20+
run: |
21+
script/check-english-links.js > broken_links.md
22+
- if: ${{ failure() }}
23+
name: Get title for issue
24+
id: check
25+
run: echo "::set-output name=title::$(head -1 broken_links.md)"
26+
- if: ${{ failure() }}
27+
name: Close previous report
28+
uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
29+
with:
30+
query: 'label:"broken link report"'
31+
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
32+
- if: ${{ failure() }}
33+
name: Create issue from file
34+
id: broken-link-report
35+
uses: peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326
36+
with:
37+
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
38+
title: ${{ steps.check.outputs.title }}
39+
content-filepath: ./broken_links.md
40+
labels: broken link report
41+
- if: ${{ failure() }}
42+
name: Add comment to issue
43+
uses: peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd
44+
with:
45+
body: |
46+
cc @github/docs-content
47+
issue-number: ${{ steps.broken-link-report.outputs.issue-number }}
48+
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}

.github/workflows/codeql.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: "CodeQL analysis"
1+
name: CodeQL analysis
22

33
on:
44
push:
55
paths:
6-
- '**/*.js'
7-
- '.github/workflows/codeql.yml'
6+
- '**/*.js'
7+
- '.github/workflows/codeql.yml'
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
15-
- uses: github/codeql-action/init@v1
16-
with:
17-
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
18-
- uses: github/codeql-action/analyze@v1
19-
continue-on-error: true
14+
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
15+
- uses: github/codeql-action/init@v1
16+
with:
17+
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
18+
- uses: github/codeql-action/analyze@v1
19+
continue-on-error: true

.github/workflows/crowdin.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Crowdin Sync
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "33 2 * * *" # every day at 2:33 UTC at least until automerge is working
6+
- cron: '33 2 * * *' # every day at 2:33 UTC at least until automerge is working
77

88
jobs:
99
sync_with_crowdin:
@@ -20,7 +20,7 @@ jobs:
2020
upload_translations: false
2121
download_translations: true
2222
create_pull_request: true
23-
23+
2424
# Using a custom config temporarily to avoid clobbering the existing crowdin.yml
2525
# that is used by the github-help-docs OAuth integration.
2626
config: 'crowdin.yml'
@@ -35,17 +35,15 @@ jobs:
3535
crowdin_branch_name: main
3636

3737
env:
38-
# Using an @octoglot token instead of the default Actions-provided GITHUB_TOKEN here
38+
# Using an @octoglot token instead of the default Actions-provided GITHUB_TOKEN here
3939
# so that subsequent workflows will be able to run on the pull request created by this workflow.
4040
GITHUB_TOKEN: ${{ secrets.OCTOGLOT_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
4141

4242
# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string
4343
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api
4444
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
45-
45+
4646
# A personal access token, not to be confused with Crowdin API v1 "API key"
4747
# See https://crowdin.com/settings#api-key to generate a token
4848
# This token was created by logging into Crowdin with the octoglot user
4949
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
50-
51-

0 commit comments

Comments
 (0)