Skip to content

Commit 36f73f3

Browse files
author
Kathy Korevec
authored
Merge branch 'main' into patch-1
2 parents 3a1ecd7 + cbbe42b commit 36f73f3

File tree

3,233 files changed

+2382163
-143724
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,233 files changed

+2382163
-143724
lines changed

.env.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
ALGOLIA_API_KEY=
22
ALGOLIA_APPLICATION_ID=
33
ALLOW_TRANSLATION_COMMITS=
4-
EARLY_ACCESS_HOSTNAME=
5-
EARLY_ACCESS_SHARED_SECRET=
6-
GITHUB_TOKEN=

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ package.json @github/docs-engineering
2020
# Site Policy
2121
/content/github/site-policy/ @github/site-policy-admins
2222

23+
# Content strategy
24+
/contributing/content-markup-reference.md @github/product-docs-content-strategy
25+
/contributing/content-style-guide.md @github/product-docs-content-strategy
26+
2327
# Make sure that Octokit maintainers get notified about changes
2428
# relevant to the Octokit libraries (https://github.com/octokit)
2529
/content/rest/reference @github/octokit-maintainers

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ labels:
77
assignees: ''
88
---
99
<!--
10-
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT https://github.com/github/docs-content/issues/new/choose INSTEAD.
10+
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
1111
-->
1212

1313
<!--
1414
For questions, ask in Discussions: https://github.com/github/docs/discussions
1515
16-
Before you file an issue read the:
16+
Before you file an issue read the:
1717
- Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md
1818
- Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md
1919

.github/ISSUE_TEMPLATE/improve-the-site.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ assignees: ''
77
---
88

99
<!--
10-
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT https://github.com/github/docs-content/issues/new/choose INSTEAD.
10+
HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
1111
-->
1212

1313
<!--
1414
For questions, ask in Discussions: https://github.com/github/docs/discussions
1515
16-
Before you file an issue read the:
16+
Before you file an issue read the:
1717
- Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md
1818
- Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md
1919
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',
2526
'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',
31-
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
32-
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0'
33+
'someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd',
34+
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0',
35+
'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575'
3336
]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: autoupdate reposync branch on cron
2+
on:
3+
schedule:
4+
- cron: '*/5 * * * *'
5+
jobs:
6+
autoupdate:
7+
name: autoupdate
8+
runs-on: ubuntu-18.04
9+
steps:
10+
- uses: docker://chinthakagodawita/autoupdate-action:v1
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
13+
PR_FILTER: labelled
14+
PR_LABELS: 'automated-reposync-pr'
15+
MERGE_MSG: "Branch was updated using the 'autoupdate reposync branch on cron' Actions workflow."

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,32 @@ jobs:
1717
- name: npm run build
1818
run: npm run build
1919
- name: Run script
20-
run: script/check-english-links.js > broken_links.md
20+
run: |
21+
script/check-english-links.js > broken_links.md
2122
- if: ${{ failure() }}
2223
name: Get title for issue
2324
id: check
2425
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 }}
2532
- if: ${{ failure() }}
2633
name: Create issue from file
34+
id: broken-link-report
2735
uses: peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326
2836
with:
2937
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
3038
title: ${{ steps.check.outputs.title }}
3139
content-filepath: ./broken_links.md
3240
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 }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Close unwanted pull requests
2+
on:
3+
pull_request:
4+
paths:
5+
- '.github/workflows/**'
6+
- '.github/CODEOWNERS'
7+
- 'translations/**'
8+
- 'assets/fonts/**'
9+
- 'data/graphql/**'
10+
- 'lib/graphql/**'
11+
- 'lib/redirects/**'
12+
- 'lib/webhooks/**'
13+
jobs:
14+
close_unwanted_pull_requests:
15+
if: github.repository == 'github/docs' && github.event.pull_request.user.login != 'Octomerger'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
19+
with:
20+
script: |
21+
await github.issues.createComment({
22+
...context.repo,
23+
issue_number: context.payload.pull_request.number,
24+
body:
25+
`Thanks for contributing! We do not accept community changes to these files at this time.
26+
- '.github/workflows/**'
27+
- '.github/CODEOWNERS'
28+
- 'translations/**'
29+
- 'assets/fonts/**'
30+
- 'data/graphql/**'
31+
- 'lib/graphql/**'
32+
- 'lib/redirects/**'
33+
- 'lib/webhooks/**'`
34+
})
35+
await github.issues.update({
36+
...context.repo,
37+
issue_number: context.payload.pull_request.number,
38+
state: 'closed'
39+
})

0 commit comments

Comments
 (0)