Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ylemkimon authored Dec 2, 2020
2 parents d49ccb0 + c844b94 commit 2220b6c
Show file tree
Hide file tree
Showing 3,244 changed files with 1,755,311 additions and 149,378 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
28 changes: 28 additions & 0 deletions .eslintrc.js
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
}
}
]
}
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Thanks again!

### Check off the following:
- [ ] All of the tests are passing.
- [ ] I have reviewed my changes in staging.
- [ ] I have reviewed my changes in staging. (look for the **deploy-to-heroku** link in your pull request, then click **View deployment**)
- [ ] For content changes, I have reviewed the [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md)
- [ ] 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).
36 changes: 36 additions & 0 deletions .github/actions-scripts/enterprise-algolia-label.js
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)
41 changes: 41 additions & 0 deletions .github/actions-scripts/openapi-schema-branch.js
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)
7 changes: 5 additions & 2 deletions .github/allowed-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ module.exports = [
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b',
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
'lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8',
'pascalgn/automerge-action@c9bd182',
'peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5',
'peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326',
'peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd',
'peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8',
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815',
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0'
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0',
'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575'
]
25 changes: 13 additions & 12 deletions .github/workflows/60-days-stale-check.yml
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@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'

- 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'
8 changes: 4 additions & 4 deletions .github/workflows/auto-label-prs.yml
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 }}'
8 changes: 4 additions & 4 deletions .github/workflows/automerge-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Auto Merge Dependency Updates
on:
pull_request:
paths:
- "package*.json"
- "Gemfile*"
- "Dockerfile"
- ".github/workflows/**"
- 'package*.json'
- 'Gemfile*'
- 'Dockerfile'
- '.github/workflows/**'
pull_request_review:
types:
- edited
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'automerge') || contains(github.event.pull_request.labels.*.name, 'autosquash')
steps:
- name: automerge
uses: "pascalgn/automerge-action@c9bd182"
uses: 'pascalgn/automerge-action@c9bd182'
env:
GITHUB_TOKEN: "${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}"
MERGE_METHOD_LABELS: "automerge=merge,autosquash=squash"
MERGE_COMMIT_MESSAGE: "pull-request-title"
MERGE_METHOD: "merge"
MERGE_FORKS: "true"
MERGE_RETRIES: "50"
MERGE_RETRY_SLEEP: "10000" # ten seconds
UPDATE_LABELS: "automerge,autosquash"
UPDATE_METHOD: "merge"
GITHUB_TOKEN: '${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}'
MERGE_METHOD_LABELS: 'automerge=merge,autosquash=squash'
MERGE_COMMIT_MESSAGE: 'pull-request-title'
MERGE_METHOD: 'merge'
MERGE_FORKS: 'true'
MERGE_RETRIES: '50'
MERGE_RETRY_SLEEP: '10000' # ten seconds
UPDATE_LABELS: 'automerge,autosquash'
UPDATE_METHOD: 'merge'
12 changes: 8 additions & 4 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ jobs:
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"]'
build:
needs: see_if_should_skip
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
# Even if if doesn't do anything
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Install
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Install
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
with:
args: npm ci

- name: Test
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Test
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
with:
args: npm run browser-test
56 changes: 36 additions & 20 deletions .github/workflows/check-all-english-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,46 @@ name: Check all English links
on:
workflow_dispatch:
schedule:
- cron: "40 19 * * *" # once a day at 19:40 UTC / 11:40 PST
- cron: '40 19 * * *' # once a day at 19:40 UTC / 11:40 PST

jobs:
check_all_english_links:
name: Check all links
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci
run: npm ci
- name: npm run build
run: npm run build
- name: Run script
run: script/check-english-links.js > broken_links.md
- if: ${{ failure() }}
name: Get title for issue
id: check
run: echo "::set-output name=title::$(head -1 broken_links.md)"
- if: ${{ failure() }}
name: Create issue from file
uses: peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5
with:
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
title: ${{ steps.check.outputs.title }}
content-filepath: ./broken_links.md
labels: broken link report
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci
run: npm ci
- name: npm run build
run: npm run build
- name: Run script
run: |
script/check-english-links.js > broken_links.md
- if: ${{ failure() }}
name: Get title for issue
id: check
run: echo "::set-output name=title::$(head -1 broken_links.md)"
- if: ${{ failure() }}
name: Close previous report
uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
with:
query: 'label:"broken link report"'
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
- if: ${{ failure() }}
name: Create issue from file
id: broken-link-report
uses: peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326
with:
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
title: ${{ steps.check.outputs.title }}
content-filepath: ./broken_links.md
labels: broken link report
- if: ${{ failure() }}
name: Add comment to issue
uses: peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd
with:
body: |
cc @github/docs-content
issue-number: ${{ steps.broken-link-report.outputs.issue-number }}
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
20 changes: 10 additions & 10 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: "CodeQL analysis"
name: CodeQL analysis

on:
push:
paths:
- '**/*.js'
- '.github/workflows/codeql.yml'
- '**/*.js'
- '.github/workflows/codeql.yml'

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: github/codeql-action/init@v1
with:
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
- uses: github/codeql-action/analyze@v1
continue-on-error: true
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: github/codeql-action/init@v1
with:
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
- uses: github/codeql-action/analyze@v1
continue-on-error: true
10 changes: 4 additions & 6 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Crowdin Sync
on:
workflow_dispatch:
schedule:
- cron: "33 2 * * *" # every day at 2:33 UTC at least until automerge is working
- cron: '33 2 * * *' # every day at 2:33 UTC at least until automerge is working

jobs:
sync_with_crowdin:
Expand All @@ -20,7 +20,7 @@ jobs:
upload_translations: false
download_translations: true
create_pull_request: true

# Using a custom config temporarily to avoid clobbering the existing crowdin.yml
# that is used by the github-help-docs OAuth integration.
config: 'crowdin.yml'
Expand All @@ -35,17 +35,15 @@ jobs:
crowdin_branch_name: main

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

# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}

# A personal access token, not to be confused with Crowdin API v1 "API key"
# See https://crowdin.com/settings#api-key to generate a token
# This token was created by logging into Crowdin with the octoglot user
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}


Loading

0 comments on commit 2220b6c

Please sign in to comment.