Skip to content

Commit 274e499

Browse files
authored
Merge branch 'main' into issue/5848
2 parents 204ce61 + 1a9af0c commit 274e499

File tree

2,581 files changed

+362932
-71443
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,581 files changed

+362932
-71443
lines changed

.devcontainer.json

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

.devcontainer/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/javascript-node/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Node.js version: 16, 14, 12
4+
ARG VARIANT="16-buster"
5+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
# && apt-get -y install --no-install-recommends <your-package-list-here>
10+
11+
# [Optional] Uncomment if you want to install an additional version of node using nvm
12+
# ARG EXTRA_NODE_VERSION=10
13+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
14+
15+
# [Optional] Uncomment if you want to install more global node modules
16+
# RUN su node -c "npm install -g <your-package-list-here>"

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/javascript-node
3+
{
4+
"name": "docs.github.com",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 12, 14, 16
8+
"args": { "VARIANT": "16" }
9+
},
10+
11+
// Set *default* container specific settings.json values on container create.
12+
"settings": {
13+
"terminal.integrated.shell.linux": "/bin/bash",
14+
"cSpell.language": ",en"
15+
},
16+
17+
// Visual Studio Code extensions which help authoring for docs.github.com.
18+
"extensions": [
19+
"dbaeumer.vscode-eslint",
20+
"sissel.shopify-liquid",
21+
"davidanson.vscode-markdownlint",
22+
"bierner.markdown-preview-github-styles",
23+
"yzhang.markdown-all-in-one",
24+
"streetsidesoftware.code-spell-checker"
25+
],
26+
27+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
28+
"forwardPorts": [4000],
29+
30+
// Use 'postCreateCommand' to run commands after the container is created.
31+
"postCreateCommand": "npm ci && npm run build",
32+
33+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
34+
"remoteUser": "node"
35+
}

.eslintrc.js

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,40 @@ module.exports = {
33
browser: true,
44
commonjs: true,
55
es2020: true,
6-
node: true
6+
node: true,
77
},
88
parser: '@babel/eslint-parser',
9-
extends: [
10-
'eslint:recommended',
11-
'standard',
12-
'prettier'
13-
],
9+
extends: ['eslint:recommended', 'standard', 'prettier'],
1410
parserOptions: {
15-
ecmaVersion: 11
11+
ecmaVersion: 11,
12+
requireConfigFile: 'false',
13+
babelOptions: { configFile: './.babelrc' },
1614
},
1715
rules: {
18-
'import/no-extraneous-dependencies': ['error']
16+
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
17+
'node/global-require': ['error'],
18+
'import/no-dynamic-require': ['error'],
1919
},
2020
overrides: [
2121
{
22-
files: [
23-
'**/tests/**/*.js'
24-
],
22+
files: ['**/tests/**/*.js'],
2523
env: {
26-
jest: true
27-
}
24+
jest: true,
25+
},
2826
},
2927
{
30-
files: [
31-
'**/*.tsx', '**/*.ts'
32-
],
33-
plugins: [
34-
'@typescript-eslint',
35-
'jsx-a11y'
36-
],
28+
files: ['**/*.tsx', '**/*.ts'],
29+
plugins: ['@typescript-eslint', 'jsx-a11y'],
3730
extends: ['plugin:jsx-a11y/recommended'],
3831
parser: '@typescript-eslint/parser',
3932
rules: {
40-
'camelcase': 'off',
33+
camelcase: 'off',
4134
'no-unused-vars': 'off',
4235
'no-undef': 'off',
4336
'no-use-before-define': 'off',
4437
'@typescript-eslint/no-unused-vars': ['error'],
4538
'jsx-a11y/no-onchange': 'off',
46-
}
39+
},
4740
},
48-
]
41+
],
4942
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
name: Improve existing docs
3-
about: Make a suggestion to improve our existing documentation.
2+
name: Improve existing content
3+
about: Make a suggestion to improve the content in an existing article.
44
title: ''
55
labels:
66
- content

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Improve the docs.github.com site
3-
about: Make a suggestions or report a problem on the docs.github.com website.
3+
about: Make a suggestion or report a problem about the technical implementation of docs.github.com.
44
title: ''
55
labels: engineering
66
assignees: ''
Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
#!/usr/bin/env node
22

3-
const github = require('@actions/github')
4-
const core = require('@actions/core')
3+
import { getOctokit } from '@actions/github'
4+
import { setOutput } from '@actions/core'
55

6-
async function run () {
6+
async function run() {
77
const token = process.env.GITHUB_TOKEN
8-
const octokit = github.getOctokit(token)
8+
const octokit = getOctokit(token)
99
const query = encodeURIComponent('is:open repo:github/docs-internal is:issue')
10-
11-
const deprecationIssues = await octokit.request(`GET /search/issues?q=${query}+label:"enterprise%20deprecation"`)
12-
const releaseIssues = await octokit.request(`GET /search/issues?q=${query}+label:"enterprise%20release"`)
10+
11+
const deprecationIssues = await octokit.request(
12+
`GET /search/issues?q=${query}+label:"enterprise%20deprecation"`
13+
)
14+
const releaseIssues = await octokit.request(
15+
`GET /search/issues?q=${query}+label:"enterprise%20release"`
16+
)
1317
const isDeprecationIssue = deprecationIssues.data.items.length === 0 ? 'false' : 'true'
1418
const isReleaseIssue = releaseIssues.data.items.length === 0 ? 'false' : 'true'
15-
core.setOutput('deprecationIssue', isDeprecationIssue)
16-
core.setOutput('releaseIssue', isReleaseIssue)
19+
setOutput('deprecationIssue', isDeprecationIssue)
20+
setOutput('releaseIssue', isReleaseIssue)
1721
return `Set outputs deprecationIssue: ${isDeprecationIssue}, releaseIssue: ${isReleaseIssue}`
1822
}
1923

20-
run()
21-
.then(
22-
(response) => { console.log(`Finished running: ${response}`) },
23-
(error) => {
24-
console.log(`#ERROR# ${error}`)
25-
process.exit(1)
26-
}
27-
)
24+
run().then(
25+
(response) => {
26+
console.log(`Finished running: ${response}`)
27+
},
28+
(error) => {
29+
console.log(`#ERROR# ${error}`)
30+
process.exit(1)
31+
}
32+
)
Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env node
22

3-
const fs = require('fs')
4-
const path = require('path')
5-
const github = require('@actions/github')
6-
const enterpriseDates = require('../../lib/enterprise-dates')
7-
const { latest, oldestSupported } = require('../../lib/enterprise-server-releases')
3+
import fs from 'fs'
4+
import path from 'path'
5+
import { getOctokit } from '@actions/github'
6+
import enterpriseDates from '../../lib/enterprise-dates.js'
7+
import { latest, oldestSupported } from '../../lib/enterprise-server-releases.js'
8+
89
const acceptedMilestones = ['release', 'deprecation']
910
const teamsToCC = '/cc @github/docs-content @github/docs-engineering'
1011

@@ -19,47 +20,46 @@ const numberOfdaysBeforeDeprecationToOpenIssue = 15
1920
// number of days.
2021
//
2122
// When a milestone is within the specified number of days, a new issue is
22-
// created using the templates in
23-
// .github/actions-scripts/enterprise-server-issue-templates.
23+
// created using the templates in
24+
// .github/actions-scripts/enterprise-server-issue-templates.
2425
//
2526
// Release issues are then added to the docs content squad board for triage.
26-
// Deprecations issues are owned by docs engineering and are added to the
27+
// Deprecations issues are owned by docs engineering and are added to the
2728
// docs engineering squad board automatically when the engineering label is added.
2829
//
2930
// [end-readme]
3031

3132
run()
3233

33-
async function run () {
34-
35-
34+
async function run() {
3635
const milestone = process.argv[2]
3736
if (!acceptedMilestones.includes(milestone)) {
38-
console.log('Please specify either \'release\' or \'deprecation\'\n')
37+
console.log("Please specify either 'release' or 'deprecation'\n")
3938
console.log('Example: script/open-enterprise-issue.js release')
4039
process.exit(1)
4140
}
4241

43-
const repoToOpenIssue = milestone === 'release' ? 'docs-content' : 'docs-engineering'
44-
4542
// Milestone-dependent values.
46-
const numberOfdaysBeforeMilestoneToOpenIssue = milestone === 'release'
47-
? numberOfdaysBeforeReleaseToOpenIssue
48-
: numberOfdaysBeforeDeprecationToOpenIssue
43+
const numberOfdaysBeforeMilestoneToOpenIssue =
44+
milestone === 'release'
45+
? numberOfdaysBeforeReleaseToOpenIssue
46+
: numberOfdaysBeforeDeprecationToOpenIssue
4947

50-
const versionNumber = milestone === 'release'
51-
? getNextVersionNumber()
52-
: oldestSupported
48+
const versionNumber = milestone === 'release' ? getNextVersionNumber() : oldestSupported
5349

5450
if (!versionNumber) {
55-
console.log(`Could not find the next version number after ${latest} in enterprise-dates.json. Try running script/udpate-enterprise-dates.js, then rerun this script.`)
51+
console.log(
52+
`Could not find the next version number after ${latest} in enterprise-dates.json. Try running script/udpate-enterprise-dates.js, then rerun this script.`
53+
)
5654
process.exit(0)
5755
}
5856

5957
const datesForVersion = enterpriseDates[versionNumber]
6058

6159
if (!datesForVersion) {
62-
console.log(`Could not find ${versionNumber} in enterprise-dates.json. Try running script/udpate-enterprise-dates.js, then rerun this script.`)
60+
console.log(
61+
`Could not find ${versionNumber} in enterprise-dates.json. Try running script/udpate-enterprise-dates.js, then rerun this script.`
62+
)
6363
process.exit(0)
6464
}
6565

@@ -68,12 +68,20 @@ async function run () {
6868

6969
// If the milestone is more than the specific days away, exit now.
7070
if (daysUntilMilestone > numberOfdaysBeforeMilestoneToOpenIssue) {
71-
console.log(`The ${versionNumber} ${milestone} is not until ${nextMilestoneDate}! An issue will be opened when it is ${numberOfdaysBeforeMilestoneToOpenIssue} days away.`)
71+
console.log(
72+
`The ${versionNumber} ${milestone} is not until ${nextMilestoneDate}! An issue will be opened when it is ${numberOfdaysBeforeMilestoneToOpenIssue} days away.`
73+
)
7274
process.exit(0)
7375
}
7476

75-
const milestoneSteps = fs.readFileSync(path.join(process.cwd(), `.github/actions-scripts/enterprise-server-issue-templates/${milestone}-issue.md`), 'utf8')
76-
const issueLabels = [`enterprise ${milestone}`]
77+
const milestoneSteps = fs.readFileSync(
78+
path.join(
79+
process.cwd(),
80+
`.github/actions-scripts/enterprise-server-issue-templates/${milestone}-issue.md`
81+
),
82+
'utf8'
83+
)
84+
const issueLabels = [`enterprise ${milestone}`, `engineering`]
7785
const issueTitle = `[${nextMilestoneDate}] Enterprise Server ${versionNumber} ${milestone} (technical steps)`
7886

7987
const issueBody = `GHES ${versionNumber} ${milestone} occurs on ${nextMilestoneDate}.
@@ -83,68 +91,70 @@ async function run () {
8391
const token = process.env.GITHUB_TOKEN
8492

8593
// Create the milestone issue
86-
const octokit = github.getOctokit(token)
94+
const octokit = getOctokit(token)
8795
try {
8896
issue = await octokit.request('POST /repos/{owner}/{repo}/issues', {
8997
owner: 'github',
90-
repo: repoToOpenIssue,
98+
repo: 'docs-internal',
9199
title: issueTitle,
92100
body: issueBody,
93-
labels: issueLabels
101+
labels: issueLabels,
94102
})
95103
if (issue.status === 201) {
96104
// Write the values to disk for use in the workflow.
97-
console.log(`Issue #${issue.data.number} for the ${versionNumber} ${milestone} was opened: ${issue.data.html_url}`)
105+
console.log(
106+
`Issue #${issue.data.number} for the ${versionNumber} ${milestone} was opened: ${issue.data.html_url}`
107+
)
98108
}
99109
} catch (error) {
100110
console.error(`#ERROR# ${error}`)
101111
console.log(`🛑 There was an error creating the issue.`)
102112
process.exit(1)
103113
}
104114

105-
// Add the release issue to the 'Needs triage' column on the
115+
// Add the release issue to the 'Needs triage' column on the
106116
// docs content squad project board:
107117
// https://github.com/orgs/github/projects/1773#column-12198119
108118
// Deprecation issues are owned by docs engineering only and will
109119
// be triaged by adding the engineering label to the issue.
110120
if (milestone === 'release') {
111121
try {
112122
const addCard = await octokit.request('POST /projects/columns/{column_id}/cards', {
113-
column_id: 12198119,
123+
column_id: 12198119,
114124
content_id: issue.data.id,
115125
content_type: 'Issue',
116126
mediaType: {
117-
previews: [
118-
'inertia'
119-
]
120-
}
127+
previews: ['inertia'],
128+
},
121129
})
122130

123131
if (addCard.status === 201) {
124132
// Write the values to disk for use in the workflow.
125-
console.log(`The issue #${issue.data.number} was added to https://github.com/orgs/github/projects/1773#column-12198119.`)
126-
}
127-
} catch(error) {
133+
console.log(
134+
`The issue #${issue.data.number} was added to https://github.com/orgs/github/projects/1773#column-12198119.`
135+
)
136+
}
137+
} catch (error) {
128138
console.error(`#ERROR# ${error}`)
129139
console.log(`🛑 There was an error adding the issue to the project board.`)
130140
process.exit(1)
131141
}
132142
}
133143
}
134144

135-
function getNextVersionNumber () {
145+
function getNextVersionNumber() {
136146
const indexOfLatest = Object.keys(enterpriseDates).indexOf(latest)
137147
const indexOfNext = indexOfLatest + 1
138148
return Object.keys(enterpriseDates)[indexOfNext]
139149
}
140150

141-
function calculateDaysUntilMilestone (nextMilestoneDate) {
151+
function calculateDaysUntilMilestone(nextMilestoneDate) {
142152
const today = new Date().toISOString().slice(0, 10)
143153
const differenceInMilliseconds = getTime(nextMilestoneDate) - getTime(today)
144154
// Return the difference in days
145-
return Math.floor((differenceInMilliseconds) / (1000 * 60 * 60 * 24))
155+
return Math.floor(differenceInMilliseconds / (1000 * 60 * 60 * 24))
146156
}
147157

148-
function getTime (date) {
158+
function getTime(date) {
149159
return new Date(date).getTime()
150160
}

0 commit comments

Comments
 (0)