forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into experiment-with-react-and-mdx
- Loading branch information
Showing
9,767 changed files
with
2,456,074 additions
and
237,242 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Codespaces environment for docs.github.com | ||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json | ||
{ | ||
"name": "docs.github.com", | ||
"service": "container-doc", | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"cSpell.language": ",en" | ||
}, | ||
// Install pre-requisites, and start to serve docs.github.com locally | ||
"postCreateCommand": "npm install && npm start", | ||
"forwardPorts": [4000], | ||
// Visual Studio Code extensions which help authoring for docs.github.com. | ||
"extensions": [ | ||
"yzhang.markdown-all-in-one", | ||
"streetsidesoftware.code-spell-checker" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es2020: true, | ||
node: true | ||
}, | ||
parser: 'babel-eslint', | ||
extends: [ | ||
'eslint:recommended', | ||
'standard' | ||
], | ||
parserOptions: { | ||
ecmaVersion: 11 | ||
}, | ||
rules: { | ||
}, | ||
overrides: [ | ||
{ | ||
files: [ | ||
'**/tests/**/*.js' | ||
], | ||
env: { | ||
jest: true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs') | ||
const core = require('@actions/core') | ||
const eventPayload = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')) | ||
|
||
// This workflow-run script does the following: | ||
// 1. Gets an array of labels on a PR. | ||
// 2. Finds one with the relevant Algolia text; if none found, exits early. | ||
// 3. Gets the version substring from the label string. | ||
|
||
const labelText = 'sync-english-index-for-' | ||
const labelsArray = eventPayload.pull_request.labels | ||
|
||
// Exit early if no labels are on this PR | ||
if (!(labelsArray && labelsArray.length)) { | ||
process.exit(0) | ||
} | ||
|
||
// Find the relevant label | ||
const algoliaLabel = labelsArray | ||
.map(label => label.name) | ||
.find(label => label.startsWith(labelText)) | ||
|
||
// Exit early if no relevant label is found | ||
if (!algoliaLabel) { | ||
process.exit(0) | ||
} | ||
|
||
// Given: sync-english-index-for-enterprise-server@3.0 | ||
// Returns: enterprise-server@3.0 | ||
const versionToSync = algoliaLabel.split(labelText)[1] | ||
|
||
// Store the version so we can access it later in the workflow | ||
core.setOutput('versionToSync', versionToSync) | ||
process.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs') | ||
const path = require('path') | ||
const { execSync } = require('child_process') | ||
const semver = require('semver') | ||
|
||
/* | ||
* This script performs two checks to prevent shipping development mode OpenAPI schemas: | ||
* - Ensures the `info.version` property is a semantic version. | ||
* In development mode, the `info.version` property is a string | ||
* containing the `github/github` branch name. | ||
* - Ensures the decorated schema matches the dereferenced schema. | ||
* The workflow that calls this script runs `script/rest/update-files.js` | ||
* with the `--decorate-only` switch then checks to see if files changed. | ||
* | ||
*/ | ||
|
||
// Check that the `info.version` property is a semantic version | ||
const dereferencedDir = path.join(process.cwd(), 'lib/rest/static/dereferenced') | ||
const schemas = fs.readdirSync(dereferencedDir) | ||
schemas.forEach(filename => { | ||
const schema = require(path.join(dereferencedDir, filename)) | ||
if (!semver.valid(schema.info.version)) { | ||
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. 🛑`) | ||
process.exit(1) | ||
} | ||
}) | ||
|
||
// Check that the decorated schema matches the dereferenced schema | ||
const changedFiles = execSync('git diff --name-only HEAD').toString() | ||
|
||
if(changedFiles !== '') { | ||
console.log(`These files were changed:\n${changedFiles}`) | ||
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'. 🛑`) | ||
process.exit(1) | ||
} | ||
|
||
// All checks pass, ready to ship | ||
console.log('All good 👍') | ||
process.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
name: 60 Days Stale Check | ||
on: | ||
schedule: | ||
- cron: "40 16 * * *" # Run each day at 16:40 UTC / 8:40 PST | ||
- cron: '40 16 * * *' # Run each day at 16:40 UTC / 8:40 PST | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@44f9eae0adddf72dbf3eedfacc999f70afcec1a8 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.' | ||
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.' | ||
days-before-stale: 60 | ||
days-before-close: -1 | ||
only-labels: 'engineering' | ||
stale-issue-label: 'stale' | ||
stale-pr-label: 'stale' | ||
|
||
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.' | ||
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.' | ||
days-before-stale: 60 | ||
days-before-close: -1 | ||
only-labels: 'engineering' | ||
stale-issue-label: 'stale' | ||
stale-pr-label: 'stale' | ||
exempt-pr-labels: 'never-stale' | ||
exempt-issue-labels: 'never-stale' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
name: Auto label Pull Requests | ||
on: | ||
- pull_request | ||
pull_request: | ||
|
||
jobs: | ||
triage: | ||
if: github.repository == 'github/docs-internal' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb | ||
with: | ||
repo-token: '${{ secrets.GITHUB_TOKEN }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.