1
0
mirror of synced 2025-12-23 11:54:18 -05:00

Merge branch 'main' into cindyalvarez-patch-1

This commit is contained in:
Felicity Chapman
2021-01-19 09:20:26 +00:00
committed by GitHub
7289 changed files with 3083610 additions and 58614 deletions

View File

@@ -1,6 +1,3 @@
ALGOLIA_API_KEY= ALGOLIA_API_KEY=
ALGOLIA_APPLICATION_ID= ALGOLIA_APPLICATION_ID=
ALLOW_TRANSLATION_COMMITS= ALLOW_TRANSLATION_COMMITS=
EARLY_ACCESS_HOSTNAME=
EARLY_ACCESS_SHARED_SECRET=
GITHUB_TOKEN=

1
.eslintignore Normal file
View File

@@ -0,0 +1 @@
dist/

28
.eslintrc.js Normal file
View File

@@ -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
}
}
]
}

4
.github/CODEOWNERS vendored
View File

@@ -20,6 +20,10 @@ package.json @github/docs-engineering
# Site Policy # Site Policy
/content/github/site-policy/ @github/site-policy-admins /content/github/site-policy/ @github/site-policy-admins
# Content strategy
/contributing/content-markup-reference.md @github/docs-content-strategy
/contributing/content-style-guide.md @github/docs-content-strategy
# Make sure that Octokit maintainers get notified about changes # Make sure that Octokit maintainers get notified about changes
# relevant to the Octokit libraries (https://github.com/octokit) # relevant to the Octokit libraries (https://github.com/octokit)
/content/rest/reference @github/octokit-maintainers /content/rest/reference @github/octokit-maintainers

View File

@@ -7,13 +7,13 @@ labels:
assignees: '' assignees: ''
--- ---
<!-- <!--
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. HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
--> -->
<!-- <!--
For questions, ask in Discussions: https://github.com/github/docs/discussions For questions, ask in Discussions: https://github.com/github/docs/discussions
Before you file an issue read the: Before you file an issue read the:
- Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md - Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md
- Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md - Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md

View File

@@ -7,13 +7,13 @@ assignees: ''
--- ---
<!-- <!--
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. HUBBERS BEWARE! THE GITHUB/DOCS REPO IS PUBLIC TO THE ENTIRE INTERNET. OPEN AN ISSUE IN GITHUB/DOCS-CONTENT INSTEAD.
--> -->
<!-- <!--
For questions, ask in Discussions: https://github.com/github/docs/discussions For questions, ask in Discussions: https://github.com/github/docs/discussions
Before you file an issue read the: Before you file an issue read the:
- Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md - Code of Conduct: https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md
- Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md - Contributing guide: https://github.com/github/docs/blob/main/CONTRIBUTING.md

View File

@@ -21,7 +21,6 @@ Thanks again!
<!-- Share artifacts of the changes, be they code snippets, GIFs or screenshots; whatever shares the most context. --> <!-- Share artifacts of the changes, be they code snippets, GIFs or screenshots; whatever shares the most context. -->
### Check off the following: ### Check off the following:
- [ ] All of the tests are passing. - [ ] I have reviewed my changes in staging. (look for the **deploy-to-heroku** link in your pull request, then click **View deployment**)
- [ ] I have reviewed my changes in staging.
- [ ] 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 [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). - [ ] 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).

View File

@@ -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)

View File

@@ -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)

View File

@@ -12,6 +12,8 @@ module.exports = [
'actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526', //actions/setup-ruby@v1.1.2 'actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526', //actions/setup-ruby@v1.1.2
'actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4', //actions/stale@v3.0.13 'actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4', //actions/stale@v3.0.13
'crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688', 'crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688',
'crykn/copy_folder_to_another_repo_action@abc264e1c16eb3d7b1f7763bfdb0e1699ad43120',
'cschleiden/actions-linter@43fd4e08e52ed40c0e2782dc2425694388851576',
'dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911', 'dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911',
'docker://chinthakagodawita/autoupdate-action:v1', 'docker://chinthakagodawita/autoupdate-action:v1',
'fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289', 'fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289',
@@ -21,13 +23,17 @@ module.exports = [
'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8', 'juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8',
'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b', 'juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b',
'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512', 'juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512',
'lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8',
'pascalgn/automerge-action@c9bd182', 'pascalgn/automerge-action@c9bd182',
'peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5', 'peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326',
'peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8', 'peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd',
'peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43',
'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9', 'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9',
'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e', 'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e',
'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88', 'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88',
'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d', 'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d',
'rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815', 'someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd',
'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0' 'tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0',
'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575',
'dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58'
] ]

View File

@@ -1,20 +1,22 @@
name: 60 Days Stale Check name: 60 Days Stale Check
on: on:
schedule: 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: jobs:
stale: stale:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4 - uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.' 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.' stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.'
days-before-stale: 60 days-before-stale: 60
days-before-close: -1 days-before-close: -1
only-labels: 'engineering' only-labels: 'engineering'
stale-issue-label: 'stale' stale-issue-label: 'stale'
stale-pr-label: 'stale' stale-pr-label: 'stale'
exempt-pr-labels: 'never-stale'
exempt-issue-labels: 'never-stale'

View File

@@ -1,12 +1,12 @@
name: Auto label Pull Requests name: Auto label Pull Requests
on: on:
- pull_request pull_request:
jobs: jobs:
triage: triage:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb - uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb
with: with:
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: '${{ secrets.GITHUB_TOKEN }}'

View File

@@ -3,10 +3,10 @@ name: Auto Merge Dependency Updates
on: on:
pull_request: pull_request:
paths: paths:
- "package*.json" - 'package*.json'
- "Gemfile*" - 'Gemfile*'
- "Dockerfile" - 'Dockerfile'
- ".github/workflows/**" - '.github/workflows/**'
pull_request_review: pull_request_review:
types: types:
- edited - edited
@@ -14,6 +14,7 @@ on:
jobs: jobs:
run: run:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0 - uses: tjenkinson/gh-action-auto-merge-dependency-updates@cee2ac0

View File

@@ -20,17 +20,17 @@ on:
jobs: jobs:
automerge: automerge:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'automerge') || contains(github.event.pull_request.labels.*.name, 'autosquash') if: (contains(github.event.pull_request.labels.*.name, 'automerge') || contains(github.event.pull_request.labels.*.name, 'autosquash')) && (github.repository == 'github/docs-internal' || github.repository == 'github/docs')
steps: steps:
- name: automerge - name: automerge
uses: "pascalgn/automerge-action@c9bd182" uses: 'pascalgn/automerge-action@c9bd182'
env: env:
GITHUB_TOKEN: "${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}" GITHUB_TOKEN: '${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}'
MERGE_METHOD_LABELS: "automerge=merge,autosquash=squash" MERGE_METHOD_LABELS: 'automerge=merge,autosquash=squash'
MERGE_COMMIT_MESSAGE: "pull-request-title" MERGE_COMMIT_MESSAGE: 'pull-request-title'
MERGE_METHOD: "merge" MERGE_METHOD: 'merge'
MERGE_FORKS: "true" MERGE_FORKS: 'true'
MERGE_RETRIES: "50" MERGE_RETRIES: '50'
MERGE_RETRY_SLEEP: "10000" # ten seconds MERGE_RETRY_SLEEP: '10000' # ten seconds
UPDATE_LABELS: "automerge,autosquash" UPDATE_LABELS: 'automerge,autosquash'
UPDATE_METHOD: "merge" UPDATE_METHOD: 'merge'

View File

@@ -5,8 +5,9 @@ on:
- main - main
jobs: jobs:
autoupdate: autoupdate:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
name: autoupdate name: autoupdate
runs-on: ubuntu-18.04 runs-on: ubuntu-latest
steps: steps:
- uses: docker://chinthakagodawita/autoupdate-action:v1 - uses: docker://chinthakagodawita/autoupdate-action:v1
env: env:

View File

@@ -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"]' 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: build:
needs: see_if_should_skip needs: see_if_should_skip
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Install - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Install
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
with: with:
args: npm ci args: npm ci
- name: Test - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Test
uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb uses: ianwalter/puppeteer@12728ddef82390d1ecd4732fb543f62177392fbb
with: with:
args: npm run browser-test args: npm run browser-test

View File

@@ -3,7 +3,7 @@ name: Check all English links
on: on:
workflow_dispatch: workflow_dispatch:
schedule: 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: jobs:
check_all_english_links: check_all_english_links:
@@ -11,22 +11,38 @@ jobs:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: npm run build - name: npm run build
run: npm run build run: npm run build
- name: Run script - name: Run script
run: script/check-english-links.js > broken_links.md run: |
- if: ${{ failure() }} script/check-english-links.js > broken_links.md
name: Get title for issue - if: ${{ failure() }}
id: check name: Get title for issue
run: echo "::set-output name=title::$(head -1 broken_links.md)" id: check
- if: ${{ failure() }} run: echo "::set-output name=title::$(head -1 broken_links.md)"
name: Create issue from file - if: ${{ failure() }}
uses: peter-evans/create-issue-from-file@35e304e2a12caac08c568247a2cb46ecd0c3ecc5 name: Close previous report
with: uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} with:
title: ${{ steps.check.outputs.title }} query: 'label:"broken link report"'
content-filepath: ./broken_links.md token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
labels: broken link report - 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 }}

View File

@@ -1,19 +1,24 @@
name: "CodeQL analysis" name: CodeQL analysis
on: on:
push: push:
branches:
- main
pull_request:
branches:
- main
paths: paths:
- '**/*.js' - '**/*.js'
- '.github/workflows/codeql.yml' - '.github/workflows/codeql.yml'
jobs: jobs:
build: build:
runs-on: ubuntu-latest if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: github/codeql-action/init@v1 - uses: github/codeql-action/init@v1
with: with:
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!) languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp} (not YET ruby, sorry!)
- uses: github/codeql-action/analyze@v1 - uses: github/codeql-action/analyze@v1
continue-on-error: true continue-on-error: true

View File

@@ -0,0 +1,73 @@
name: Confirm internal staff meant to post in public
on:
issues:
types:
- opened
- reopened
- transferred
pull_request_target:
types:
- opened
- reopened
jobs:
check-team-membership:
runs-on: ubuntu-latest
continue-on-error: true
if: github.repository == 'github/docs'
steps:
- id: membership_check
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
script: |
// Only perform this action with GitHub employees
try {
await github.teams.getMembershipForUserInOrg({
org: 'github',
team_slug: 'employees',
username: context.payload.sender.login,
});
} catch(err) {
// An error will be thrown if the user is not a GitHub employee
// If a user is not a GitHub employee, we should stop here and
// Not send a notification
return
}
// Don't perform this action with Docs team members
try {
await github.teams.getMembershipForUserInOrg({
org: 'github',
team_slug: 'docs',
username: context.payload.sender.login,
});
// If the user is a Docs team member, we should stop here and not send
// a notification
return
} catch(err) {
// An error will be thrown if the user is not a Docs team member
// If a user is not a Docs team member we should continue and send
// the notification
}
const issueNo = context.number || context.issue.number
// Create an issue in our private repo
await github.issues.create({
owner: 'github',
repo: 'docs-internal',
title: `@${context.payload.sender.login} confirm that \#${issueNo} should be in the public github/docs repo`,
body: `@${context.payload.sender.login} opened https://github.com/github/docs/issues/${issueNo} publicly in the github/docs repo, instead of the private github/docs-internal repo.\n\n@${context.payload.sender.login}, please confirm that this belongs in the public repo and that no sensitive information was disclosed by commenting below and closing the issue.\n\nIf this was not intentional and sensitive information was shared, please delete https://github.com/github/docs/issues/${issueNo} and notify us in the \#docs-open-source channel.\n\nThanks! \n\n/cc @github/docs @github/docs-engineering`
});
core.setOutput('did_warn', 'true')
- name: Send Slack notification if a GitHub employee who isn't on the docs team opens an issue in public
if: ${{ steps.membership_check.outputs.did_warn && github.repository == 'github/docs' }}
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
with:
channel: ${{ secrets.DOCS_OPEN_SOURCE_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
text: <@${{github.actor}}> opened https://github.com/github/docs/issues/${{ github.event.number || github.event.issue.number }} publicly on the github/docs repo instead of the private github/docs-internal repo. They have been notified via a new issue in the github/docs-internal repo to confirm this was intentional.

View File

@@ -3,7 +3,7 @@ name: Crowdin Sync
on: on:
workflow_dispatch: workflow_dispatch:
schedule: 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: jobs:
sync_with_crowdin: sync_with_crowdin:
@@ -20,7 +20,7 @@ jobs:
upload_translations: false upload_translations: false
download_translations: true download_translations: true
create_pull_request: true create_pull_request: true
# Using a custom config temporarily to avoid clobbering the existing crowdin.yml # Using a custom config temporarily to avoid clobbering the existing crowdin.yml
# that is used by the github-help-docs OAuth integration. # that is used by the github-help-docs OAuth integration.
config: 'crowdin.yml' config: 'crowdin.yml'
@@ -35,17 +35,15 @@ jobs:
crowdin_branch_name: main crowdin_branch_name: main
env: 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. # 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 }} 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 # 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 # See "API v2" on https://crowdin.com/project/<your-project>/settings#api
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
# A personal access token, not to be confused with Crowdin API v1 "API key" # 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 # See https://crowdin.com/settings#api-key to generate a token
# This token was created by logging into Crowdin with the octoglot user # This token was created by logging into Crowdin with the octoglot user
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

View File

@@ -9,23 +9,23 @@ jobs:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d - uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with: with:
node-version: 14.x node-version: 14.x
- name: cache node modules - name: cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: (Dry run) sync indices - name: (Dry run) sync indices
env: env:
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run sync-search-dry-run run: npm run sync-search-dry-run

View File

@@ -1,7 +1,12 @@
name: First responder docs-content name: First responder docs-content
on: on:
pull_request: pull_request:
types: [reopened, opened, ready_for_review, closed, unlabeled] types:
- reopened
- opened
- ready_for_review
- closed
- unlabeled
jobs: jobs:
first-responder-triage-pr: first-responder-triage-pr:
@@ -10,46 +15,46 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check if the event originated from a team member - name: Check if the event originated from a team member
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
id: set-result id: set-result
with: with:
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
result-encoding: string result-encoding: string
script: | script: |
const repoName = context.payload.repository.name const repoName = context.payload.repository.name
const ownerName = context.payload.repository.owner.login const ownerName = context.payload.repository.owner.login
const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number
const updatedIssueInformation = await github.issues.get({ const updatedIssueInformation = await github.issues.get({
owner: ownerName, owner: ownerName,
repo: repoName, repo: repoName,
issue_number: issueNumber issue_number: issueNumber
}) })
const teamMembers = await github.request( const teamMembers = await github.request(
`/orgs/github/teams/docs/members` `/orgs/github/teams/docs/members`
) )
const logins = teamMembers.data.map(member => member.login) const logins = teamMembers.data.map(member => member.login)
// ignore PRs opened by docs bot accounts // ignore PRs opened by docs bot accounts
logins.push('Octomerger', 'octoglot') logins.push('Octomerger', 'octoglot')
if (logins.some(login => login === updatedIssueInformation.data.user.login)) { if (logins.some(login => login === updatedIssueInformation.data.user.login)) {
console.log(`This issue or pull request was authored by a member of the github/docs team.`) console.log(`This issue or pull request was authored by a member of the github/docs team.`)
return 'true' return 'true'
} }
console.log(`This issue or pull request was authored by an external contributor.`) console.log(`This issue or pull request was authored by an external contributor.`)
return 'false' return 'false'
- name: Label external contributor pull requests with docs-content-fr - name: Label external contributor pull requests with docs-content-fr
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
if: steps.set-result.outputs.result == 'false' if: steps.set-result.outputs.result == 'false'
with: with:
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}" repo-token: '${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}'
add-labels: "docs-content-fr" add-labels: 'docs-content-fr'
- name: Triage to FR PR project column - name: Triage to FR PR project column
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9 uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
if: steps.set-result.outputs.result == 'false' if: steps.set-result.outputs.result == 'false'
with: with:
action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
project-url: "https://github.com/orgs/github/projects/1367" project-url: 'https://github.com/orgs/github/projects/1367'
column-name: "Docs-internal external contributor PRs" column-name: 'Docs-internal external contributor PRs'
first-responder-remove-pr: first-responder-remove-pr:
name: Remove PR from FR project board name: Remove PR from FR project board
@@ -57,29 +62,29 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Remove card from project - name: Remove card from project
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with: with:
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
result-encoding: string result-encoding: string
script: | script: |
const issueToRemove = context.payload.number const issueToRemove = context.payload.number
const cards = await github.projects.listCards({ const cards = await github.projects.listCards({
column_id: 11130889 column_id: 11130889
}) })
cards.data.forEach(card => { cards.data.forEach(card => {
if (card.content_url) { if (card.content_url) {
const cardIssueNumber = parseInt(card.content_url.split('/').pop(), 10) const cardIssueNumber = parseInt(card.content_url.split('/').pop(), 10)
if (cardIssueNumber === issueToRemove) { if (cardIssueNumber === issueToRemove) {
const cards = github.projects.deleteCard({ const cards = github.projects.deleteCard({
card_id: card.id card_id: card.id
}) })
}
} }
} })
}) - name: Remove docs-content-fr label if not already removed
- name: Remove docs-content-fr label if not already removed if: github.event.action == 'closed'
if: github.event.action == 'closed' uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e with:
with: repo-token: '${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}'
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}" remove-labels: 'docs-content-fr'
remove-labels: "docs-content-fr"

View File

@@ -10,23 +10,8 @@ on:
- translations - translations
jobs: jobs:
see_if_should_skip:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
with:
cancel_others: 'false'
github_token: ${{ github.token }}
paths: '["**/*.js", "package*.json", ".github/workflows/js-lint.yml"]'
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: see_if_should_skip
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
@@ -53,7 +38,7 @@ jobs:
run: npm ci run: npm ci
- name: Run linter - name: Run linter
run: npx standard run: npx eslint .
- name: Check dependencies - name: Check dependencies
run: npm run check-deps run: npm run check-deps

View File

@@ -1,7 +1,8 @@
name: Merged notification name: Merged notification
on: on:
pull_request_target: pull_request_target:
types: ['closed'] types:
- 'closed'
jobs: jobs:
comment: comment:

37
.github/workflows/openapi-decorate.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: OpenAPI generate decorated schema files
on:
workflow_dispatch:
pull_request:
types: [opened]
jobs:
generate-decorated-files:
if: github.event.pull_request.user.login == 'github-openapi-bot'
runs-on: ubuntu-latest
steps:
- name: Label pull requests with 'github-openapi-bot'
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
add-labels: 'github-openapi-bot'
- name: Checkout repository code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Install dependencies
run: npm ci
- name: Decorate the dereferenced OpenAPI schemas
run: script/rest/update-files.js --decorate-only
- name: Check in the decorated files
uses: EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575
with:
# The arguments for the `git add` command
add: 'lib/rest/static/decorated'
# The message for the commit
message: 'Add decorated OpenAPI schema files'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged

View File

@@ -0,0 +1,22 @@
name: OpenAPI dev mode check
on:
workflow_dispatch:
push:
jobs:
check-schema-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Install dependencies
run: npm ci
# Differences between decorated and dereferenced files indicates a problem
- name: Generate decorated files to check that there are no differences
run: script/rest/update-files.js --decorate-only
- name: Check if deref/decorated schemas are dev mode and that they match
run: .github/actions-scripts/openapi-schema-branch.js

View File

@@ -1,10 +1,11 @@
name: "Pa11y" name: Pa11y
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: "25 17 * * *" # once a day at 17:25 UTC / 11:50 PST - cron: '25 17 * * *' # once a day at 17:25 UTC / 11:50 PST
jobs: jobs:
test: test:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repo - name: Check out repo

View File

@@ -2,7 +2,7 @@ name: Ping staging apps
on: on:
schedule: schedule:
- cron: "*/20 * * * *" # every twenty minutes - cron: '*/20 * * * *' # every twenty minutes
jobs: jobs:
ping_staging_apps: ping_staging_apps:
@@ -12,10 +12,10 @@ jobs:
env: env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }} HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
steps: steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: npm run build - name: npm run build
run: npm run build run: npm run build
- name: Run script - name: Run script
run: script/ping-staging-apps.js run: script/ping-staging-apps.js

View File

@@ -5,7 +5,7 @@ env:
on: on:
schedule: schedule:
- cron: "20 15 * * 0" # run every Sunday at 20:15 UTC / 12:15 PST - cron: '20 15 * * 0' # run every Sunday at 20:15 UTC / 12:15 PST
jobs: jobs:
remove_unused_assets: remove_unused_assets:
@@ -13,42 +13,43 @@ jobs:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- if: ${{ env.FREEZE == 'true' }} - if: ${{ env.FREEZE == 'true' }}
run: | run: |
echo 'The repo is currently frozen! Exiting this workflow.' echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running exit 1 # prevents further steps from running
- name: Checkout - name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: Run scripts - name: Run scripts
run: | run: |
script/remove-unused-assets.js > results.md script/remove-unused-assets.js > results.md
script/remove-extraneous-translation-files.js script/remove-extraneous-translation-files.js
- name: Get script results to use in PR body - name: Get script results to use in PR body
id: results id: results
uses: juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512 uses: juliangruber/read-file-action@e0a316da496006ffd19142f0fd594a1783f3b512
with: with:
path: ./results.md path: ./results.md
- name: Remove script results file - name: Remove script results file
run: rm -rf ./results.md run: rm -rf ./results.md
- name: Create pull request - name: Create pull request
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8 uses: peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43
with: with:
# need to use a token with repo and workflow scopes for this step # need to use a token with repo and workflow scopes for this step
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
commit-message: Action ran script/remove-unused-assets.js commit-message: Action ran script/remove-unused-assets.js
title: Remove unused assets title: Remove unused assets
body: "Hello! This PR removes some files that exist in the repo but are not used in content or data files:\n\n body:
${{ steps.results.outputs.content }} "Hello! This PR removes some files that exist in the repo but are not used in content or data files:\n\n
\n\nIf you have any questions, please contact @github/docs-engineering." ${{ steps.results.outputs.content }}
labels: unused assets \n\nIf you have any questions, please contact @github/docs-engineering."
project: Core docs work for the current week labels: unused assets
project-column: Should do project: Core docs work for the current week
branch: remove-unused-assets project-column: Should do
- if: ${{ failure() }} branch: remove-unused-assets
name: Delete remote branch (if previous steps failed) - if: ${{ failure() }}
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911 name: Delete remote branch (if previous steps failed)
with: uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
github_token: ${{ secrets.GITHUB_TOKEN }} with:
branches: remove-unused-assets github_token: ${{ secrets.GITHUB_TOKEN }}
branches: remove-unused-assets

View File

@@ -16,12 +16,12 @@ env:
jobs: jobs:
check-freezer: check-freezer:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
name: Prevent merging during deployment freezes name: Prevent merging during deployment freezes
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Fail if repo merges are paused
- name: Fail if repo merges are paused if: ${{ env.FREEZE == 'true' }}
if: ${{ env.FREEZE == 'true' }} run: |
run: | echo 'Merges into the "main" branch on this repo are currently paused!'
echo 'Merges into the "main" branch on this repo are currently paused!' exit 1
exit 1

View File

@@ -2,7 +2,7 @@ name: Repo Freeze Reminders
on: on:
schedule: schedule:
- cron: "00 11 * * *" # once per day around 11:00am UTC - cron: '00 11 * * *' # once per day around 11:00am UTC
env: env:
FREEZE: ${{ secrets.FREEZE }} FREEZE: ${{ secrets.FREEZE }}
@@ -13,13 +13,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
steps: steps:
- name: Send Slack notification if repo is frozen
- name: Send Slack notification if repo is frozen uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
if: ${{ env.FREEZE == 'true' }} if: ${{ env.FREEZE == 'true' }}
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815 with:
env: channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }} bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
SLACK_USERNAME: docs-repo-sync color: info
SLACK_ICON_EMOJI: ':freezing_face:' text: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!
SLACK_COLOR: '#51A0D5' # Carolina Blue
SLACK_MESSAGE: All repo-sync runs will fail for ${{ github.repository }} because the repo is currently frozen!

62
.github/workflows/repo-sync-stalls.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: Repo Sync Stalls
on:
workflow_dispatch:
schedule:
- cron: '0 */2 * * *'
jobs:
check-freezer:
name: Check for deployment freezes
runs-on: ubuntu-latest
steps:
- name: Exit if repo is frozen
if: ${{ env.FREEZE == 'true' }}
run: |
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
repo-sync-stalls:
runs-on: ubuntu-latest
steps:
- if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
name: Check if repo sync is stalled
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
script: |
let pulls;
const owner = context.repo.owner
const repo = context.repo.repo
try {
pulls = await github.pulls.list({
owner: owner,
repo: repo,
head: `${owner}:repo-sync`,
state: 'open'
});
} catch(err) {
throw err
return
}
// Remove all pull requests that don't have the
// 'automated-reposync-pr' label
pulls.data = pulls.data.filter(pr =>
pr.labels.some(label => label.name === 'automated-reposync-pr')
)
// Search for pull requests that have been open too long
pulls.data.forEach(pr => {
const timeDelta = Date.now() - Date.parse(pr.created_at);
const minutesOpen = timeDelta / 1000 / 60;
if (minutesOpen > 180) {
core.setFailed('Repo sync appears to be stalled')
}
})
- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
if: failure()
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: Repo sync appears to be stalled for ${{github.repository}}. See https://github.com/${{github.repository}}/pulls?q=is%3Apr+is%3Aopen+label%3Aautomated-reposync-pr

View File

@@ -1,14 +1,15 @@
# The docs.github.com project has two repositories: github/docs (public) and github/docs-internal (private) # The docs.github.com project has two repositories: github/docs (public) and github/docs-internal (private)
# #
# This GitHub Actions workflow keeps the main branch of those two repos in sync. # This GitHub Actions workflow keeps the main branch of those two repos in sync.
# #
# For more details, see https://github.com/repo-sync/repo-sync#how-it-works # For more details, see https://github.com/repo-sync/repo-sync#how-it-works
name: Repo Sync name: Repo Sync
on: on:
workflow_dispatch:
schedule: schedule:
- cron: "*/15 * * * *" # every 15 minutes - cron: '*/15 * * * *' # every 15 minutes
env: env:
FREEZE: ${{ secrets.FREEZE }} FREEZE: ${{ secrets.FREEZE }}
@@ -18,65 +19,93 @@ jobs:
name: Check for deployment freezes name: Check for deployment freezes
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Exit if repo is frozen
- name: Exit if repo is frozen if: ${{ env.FREEZE == 'true' }}
if: ${{ env.FREEZE == 'true' }} run: |
run: | echo 'The repo is currently frozen! Exiting this workflow.'
echo 'The repo is currently frozen! Exiting this workflow.' exit 1 # prevents further steps from running
exit 1 # prevents further steps from running
repo-sync: repo-sync:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
name: Repo Sync name: Repo Sync
needs: check-freezer needs: check-freezer
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Check out repo - name: Sync repo to branch
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88
env:
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
with:
source_repo: ${{ secrets.SOURCE_REPO }} # https://${access_token}@github.com/github/the-other-repo.git
source_branch: main
destination_branch: repo-sync
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
- name: Sync repo to branch - name: Create pull request
uses: repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88 id: create-pull
env: uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} env:
with: GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
source_repo: ${{ secrets.SOURCE_REPO }} # https://${access_token}@github.com/github/the-other-repo.git with:
source_branch: main source_branch: repo-sync
destination_branch: repo-sync destination_branch: main
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} pr_title: 'repo sync'
pr_body: "This is an automated pull request to sync changes between the public and private repos.\n\n:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!"
pr_label: automerge,autoupdate,automated-reposync-pr
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
- name: Create pull request - name: Find pull request
uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b
env: id: find-pull-request
GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} with:
with: github-token: ${{ secrets.GITHUB_TOKEN }}
source_branch: repo-sync branch: repo-sync
destination_branch: main base: main
pr_title: "repo sync"
pr_body: "This is an automated pull request to sync changes between the public and private repos.\n\n:robot: This pull request should be merged (not squashed) to preserve continuity across repos, so please let a bot do the merging!"
pr_label: automerge,autoupdate
github_token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
- name: Find pull request - name: Approve pull request
uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b if: ${{ steps.find-pull-request.outputs.number }}
id: find-pull-request uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
branch: repo-sync number: ${{ steps.find-pull-request.outputs.number }}
base: main
- name: Approve pull request # There are cases where the branch becomes out-of-date in between the time this workflow began and when the pull request is created/updated
if: ${{ steps.find-pull-request.outputs.number }} - name: Update branch
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8 if: ${{ steps.find-pull-request.outputs.number }}
with: uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
github-token: ${{ secrets.GITHUB_TOKEN }} with:
number: ${{ steps.find-pull-request.outputs.number }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const mainHeadSha = await github.git.getRef({
...context.repo,
ref: 'heads/main'
})
console.log(`heads/main sha: ${mainHeadSha.data.object.sha}`)
- name: Send Slack notification if workflow fails const pull = await github.pulls.get({
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815 ...context.repo,
if: ${{ failure() }} pull_number: parseInt(${{ steps.find-pull-request.outputs.number }})
env: })
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }} console.log(`Pull request base sha: ${pull.data.base.sha}`)
SLACK_USERNAME: docs-repo-sync
SLACK_ICON_EMOJI: ':ohno:' if (mainHeadSha.data.object.sha !== pull.data.base.sha || pull.data.mergeable_state === 'behind') {
SLACK_COLOR: '#B90E0A' # Crimson const updateBranch = await github.pulls.updateBranch({
SLACK_MESSAGE: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=workflow%3A%22Repo+Sync%22 ...context.repo,
pull_number: parseInt(${{ steps.find-pull-request.outputs.number }})
})
console.log(updateBranch.data.message)
} else {
console.log(`Branch is already up-to-date`)
}
- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
if: failure()
with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=workflow%3A%22Repo+Sync%22

View File

@@ -1,20 +1,22 @@
name: Send Issue to EPD backlog name: Send Issue to EPD backlog
on: on:
issues: issues:
types: [labeled, reopened] types:
- labeled
- reopened
jobs: jobs:
triage: triage:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true continue-on-error: true
steps: steps:
- name: Add issues with engineering label to project board - name: Add issues with engineering label to project board
if: contains(github.event.issue.labels.*.name, 'engineering') || contains(github.event.issue.labels.*.name, 'design') || contains(github.event.issue.labels.*.name, 'Design') if: contains(github.event.issue.labels.*.name, 'engineering') || contains(github.event.issue.labels.*.name, 'design') || contains(github.event.issue.labels.*.name, 'Design')
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with: with:
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
script: | script: |
var column_id = 9659080; var column_id = 9659080;
try { try {

42
.github/workflows/site-policy-sync.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: site-policy-sync
# Controls when the action will run.
on:
# Triggers the workflow pull requests merged to the main branch
pull_request:
branches:
- main
types:
- closed
paths:
- 'content/github/site-policy/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
copy-file:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
# Pushes to other repo
- name: Push folder to another repository
uses: crykn/copy_folder_to_another_repo_action@abc264e1c16eb3d7b1f7763bfdb0e1699ad43120
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_SITEPOLICY }}
with:
source_folder: 'content/github/site-policy'
destination_repo: 'github/site-policy'
destination_branch: 'repo-sync'
destination_folder: 'Policies'
user_email: 'pcihon@users.noreply.github.com'
user_name: 'pcihon'
commit_msg: 'Automatic sync from GitHub Docs.'

View File

@@ -1,63 +1,66 @@
name: Start new engineering PR workflow name: Start new engineering PR workflow
on: on:
pull_request_target: pull_request_target:
types: [opened, reopened] types:
- opened
- reopened
jobs: jobs:
triage: triage:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true continue-on-error: true
env: env:
DRAFT_COLUMN_ID: 10095775 DRAFT_COLUMN_ID: 10095775
REGULAR_COLUMN_ID: 10095779 REGULAR_COLUMN_ID: 10095779
steps: steps:
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
continue-on-error: true continue-on-error: true
with: with:
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
script: | script: |
// Only assign the engineering folks // Only assign the engineering folks
try { try {
await github.teams.getMembershipForUserInOrg({ await github.teams.getMembershipForUserInOrg({
org: 'github', org: 'github',
team_slug: 'docs-engineering', team_slug: 'docs-engineering',
username: context.payload.sender.login, username: context.payload.sender.login,
}); });
} catch(err) { } catch(err) {
return return
} }
// Set column ID // Set column ID
const column_id = context.payload.pull_request.draft const column_id = context.payload.pull_request.draft
? process.env.DRAFT_COLUMN_ID ? process.env.DRAFT_COLUMN_ID
: process.env.REGULAR_COLUMN_ID : process.env.REGULAR_COLUMN_ID
// Try to create the card on the GitHub Project // Try to create the card on the GitHub Project
try { try {
await github.projects.createCard({ await github.projects.createCard({
column_id: column_id, column_id: column_id,
content_type: 'PullRequest', content_type: 'PullRequest',
content_id: context.payload.pull_request.id content_id: context.payload.pull_request.id
}); });
} catch(error) { } catch(error) {
console.log(error); console.log(error);
} }
// Try to set the author as the assignee // Try to set the author as the assignee
const owner = context.payload.repository.owner.login const owner = context.payload.repository.owner.login
const repo = context.payload.repository.name const repo = context.payload.repository.name
try { try {
await github.issues.addAssignees({ await github.issues.addAssignees({
owner: owner, owner: owner,
repo: repo, repo: repo,
issue_number: context.payload.pull_request.number, issue_number: context.payload.pull_request.number,
assignees: [ assignees: [
context.payload.sender.login context.payload.sender.login
] ]
}); });
} catch(error) { } catch(error) {
console.log(error); console.log(error);
} }

View File

@@ -4,7 +4,7 @@ on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: branches:
- main - main
jobs: jobs:
updateIndices: updateIndices:
@@ -12,29 +12,31 @@ jobs:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d - uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with: with:
node-version: 14.x node-version: 14.x
- name: cache node modules - name: cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with: with:
path: ~/.npm path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- name: npm ci - name: npm ci
run: npm ci run: npm ci
- name: sync indices - name: sync indices
env: env:
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }} ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run sync-search run: npm run sync-search
- name: Send slack notification if workflow run fails - name: Send slack notification if workflow run fails
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815 uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
if: failure() if: failure()
env: with:
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }} channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
SLACK_MESSAGE: The last Algolia workflow run for ${{github.repository}} failed. See https://github.com/github/docs-internal/actions?query=workflow%3AAlgolia bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last Algolia workflow run for ${{github.repository}} failed. Search actions for `workflow:Algolia`

View File

@@ -0,0 +1,46 @@
name: Algolia Sync Single English Index
on:
pull_request:
types:
- labeled
- unlabeled
- opened
- reopened
- synchronize
- ready_for_review
- unlocked
# This workflow requires a label in the format `sync-english-index-for-<PLAN@RELEASE>`
jobs:
updateIndices:
name: Update English index for single version based on a label's version
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with:
node-version: 14.x
- name: cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: npm ci
- name: Get version from Algolia label if present; only continue if the label is found.
id: getVersion
run: $GITHUB_WORKSPACE/.github/actions-scripts/enterprise-algolia-label.js
- if: ${{ steps.getVersion.outputs.versionToSync }}
name: Sync English index for single version
env:
VERSION: ${{ steps.getVersion.outputs.versionToSync }}
LANGUAGE: 'en'
ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run sync-search

View File

@@ -4,7 +4,7 @@ name: Node.js Tests - Translations
on: on:
schedule: schedule:
- cron: "10 20 * * *" # once a day at 20:10 UTC / 12:10 PST - cron: '10 20 * * *' # once a day at 20:10 UTC / 12:10 PST
jobs: jobs:
lint: lint:
@@ -38,7 +38,7 @@ jobs:
run: npm ci run: npm ci
- name: Run linter - name: Run linter
run: npx standard run: npx eslint .
- name: Check dependencies - name: Check dependencies
run: npm run check-deps run: npm run check-deps
@@ -78,4 +78,4 @@ jobs:
- name: Run tests - name: Run tests
run: npx jest tests/${{ matrix.test-group }}/ run: npx jest tests/${{ matrix.test-group }}/
env: env:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: '--max_old_space_size=4096'

View File

@@ -4,15 +4,14 @@ name: Node.js Tests - Windows
on: on:
workflow_dispatch: workflow_dispatch:
pull_request:
schedule: schedule:
- cron: "50 19 * * *" # once a day at 19:50 UTC / 11:50 PST - cron: '50 19 * * *' # once a day at 19:50 UTC / 11:50 PST
env:
CI: true
jobs: jobs:
test: test:
runs-on: windows-latest runs-on: windows-latest
if: (github.event_name != 'pull_request') || (github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'Windows') || contains(github.event.pull_request.labels.*.name, 'windows')))
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -48,4 +47,4 @@ jobs:
- name: Run tests - name: Run tests
run: npx jest tests/${{ matrix.test-group }}/ run: npx jest tests/${{ matrix.test-group }}/
env: env:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: '--max_old_space_size=4096'

View File

@@ -27,32 +27,41 @@ jobs:
with: with:
cancel_others: 'false' cancel_others: 'false'
github_token: ${{ github.token }} github_token: ${{ github.token }}
paths: '[".github/workflows/test.yml",".node-version", ".npmrc", "app.json", "content/**", "data/**","lib/**", "Dockerfile", "feature-flags.json", "Gemfile", "Gemfile.lock", "middleware/**", "node_modules/**","package.json", "package-lock.json", "server.js", "tests/**", "translations/**", "Procfile", "webpack.config.js"]' paths: '[".github/workflows/test.yml", ".node-version", ".npmrc", "app.json", "content/**", "data/**","lib/**", "Dockerfile", "feature-flags.json", "Gemfile", "Gemfile.lock", "middleware/**", "node_modules/**","package.json", "package-lock.json", "server.js", "tests/**", "translations/**", "Procfile", "webpack.config.js"]'
test: test:
needs: see_if_should_skip needs: see_if_should_skip
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 60 timeout-minutes: 60
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
test-group: [content, meta, rendering, routing, unit, links-and-images] test-group:
[content, meta, rendering, routing, unit, links-and-images, graphql]
steps: steps:
- name: Check out repo # 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: Check out repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
# Enables cloning the Early Access repo later with the relevant PAT
persist-credentials: 'false'
- name: Setup node - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Setup node
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with: with:
node-version: 14.x node-version: 14.x
- name: Get npm cache directory - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Get npm cache directory
id: npm-cache id: npm-cache
run: | run: |
echo "::set-output name=dir::$(npm config get cache)" echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with: with:
path: ${{ steps.npm-cache.outputs.dir }} path: ${{ steps.npm-cache.outputs.dir }}
@@ -60,20 +69,23 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- name: Install dependencies - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Install dependencies
run: npm ci run: npm ci
- name: Clone early access
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository == 'github/docs-internal' }}
run: npm run heroku-postbuild
env:
DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
GIT_BRANCH: ${{ github.ref }}
- name: Run build script - name: Run build script
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
run: npm run build run: npm run build
- name: Run tests - if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
name: Run tests
run: npx jest tests/${{ matrix.test-group }}/ run: npx jest tests/${{ matrix.test-group }}/
env: env:
NODE_OPTIONS: "--max_old_space_size=4096" NODE_OPTIONS: '--max_old_space_size=4096'
- name: Send Slack notification if workflow fails
uses: rtCamp/action-slack-notify@e17352feaf9aee300bf0ebc1dfbf467d80438815
if: failure() && github.ref == 'early-access'
env:
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
SLACK_MESSAGE: "Tests are failing on the `early-access` branch. https://github.com/github/docs-internal/tree/early-access"

View File

@@ -2,7 +2,7 @@ name: Translations
on: on:
schedule: schedule:
- cron: "20 19 * * *" # once a day at 19:20 UTC / 11:20 PST - cron: '20 19 * * *' # once a day at 19:20 UTC / 11:20 PST
env: env:
FREEZE: ${{ secrets.FREEZE }} FREEZE: ${{ secrets.FREEZE }}
@@ -12,45 +12,45 @@ jobs:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- if: ${{ env.FREEZE == 'true' }} - if: ${{ env.FREEZE == 'true' }}
run: | run: |
echo 'The repo is currently frozen! Exiting this workflow.' echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running exit 1 # prevents further steps from running
- name: Find original Pull Request - name: Find original Pull Request
uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b uses: juliangruber/find-pull-request-action@64d55773c959748ad30a4184f4dc102af1669f7b
id: pr id: pr
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
branch: translations branch: translations
- if: ${{ steps.pr.outputs.number }} - if: ${{ steps.pr.outputs.number }}
name: Check if already labeled name: Check if already labeled
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
id: has-label id: has-label
with: with:
script: | script: |
const { data: labels } = await github.issues.listLabelsOnIssue({ const { data: labels } = await github.issues.listLabelsOnIssue({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
issue_number: ${{ steps.pr.outputs.number }} issue_number: ${{ steps.pr.outputs.number }}
}) })
if (labels.find(label => label.name === 'automerge')) { if (labels.find(label => label.name === 'automerge')) {
return 'ok' return 'ok'
} }
- if: ${{ !steps.has-label.outputs.result }} - if: ${{ !steps.has-label.outputs.result }}
name: Approve Pull Request name: Approve Pull Request
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8 uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.pr.outputs.number }} number: ${{ steps.pr.outputs.number }}
- if: ${{ !steps.has-label.outputs.result }} - if: ${{ !steps.has-label.outputs.result }}
name: Add automerge label name: Add automerge label
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
github.issues.addLabels({ github.issues.addLabels({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
issue_number: ${{ steps.pr.outputs.number }}, issue_number: ${{ steps.pr.outputs.number }},
labels: ['automerge'] labels: ['automerge']
}) })

View File

@@ -1,7 +1,8 @@
name: Triage new issue comments name: Triage new issue comments
on: on:
issue_comment: issue_comment:
types: [created] types:
- created
jobs: jobs:
triage-issue-comments: triage-issue-comments:
@@ -9,38 +10,38 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check if the event originated from a team member - name: Check if the event originated from a team member
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
id: is-internal-contributor id: is-internal-contributor
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string result-encoding: string
script: | script: |
const repo = context.payload.repository.name const repo = context.payload.repository.name
const org = context.payload.repository.owner.login const org = context.payload.repository.owner.login
const actor = context.actor const actor = context.actor
let collaboratorStatus = '' let collaboratorStatus = ''
try { try {
collaboratorStatus = await github.request('GET /repos/{owner}/{repo}/collaborators/{username}', { collaboratorStatus = await github.request('GET /repos/{owner}/{repo}/collaborators/{username}', {
owner: org, owner: org,
repo: repo, repo: repo,
username: actor username: actor
}) })
console.log(`This issue was commented on by a Hubber.`) console.log(`This issue was commented on by a Hubber.`)
return 'true' return 'true'
} catch (error) { } catch (error) {
console.log(`This issue was commented on by an external contributor.`) console.log(`This issue was commented on by an external contributor.`)
return 'false' return 'false'
} }
- name: Label issues with new comments with 'triage' - name: Label issues with new comments with 'triage'
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
if: (steps.is-internal-contributor.outputs.result == 'false') if: (steps.is-internal-contributor.outputs.result == 'false')
with: with:
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: '${{ secrets.GITHUB_TOKEN }}'
add-labels: "triage" add-labels: 'triage'
- name: Triage to project board - name: Triage to project board
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9 uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
with: with:
action-token: ${{ secrets.GITHUB_TOKEN }} action-token: ${{ secrets.GITHUB_TOKEN }}
project-url: "https://github.com/github/docs/projects/1" project-url: 'https://github.com/github/docs/projects/1'
column-name: "Triage" column-name: 'Triage'

View File

@@ -1,7 +1,9 @@
name: Triage new issues name: Triage new issues
on: on:
issues: issues:
types: [reopened, opened] types:
- reopened
- opened
jobs: jobs:
triage_issues: triage_issues:
@@ -9,14 +11,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Label new issues with 'triage' - name: Label new issues with 'triage'
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
with: with:
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: '${{ secrets.GITHUB_TOKEN }}'
add-labels: "triage" add-labels: 'triage'
- name: Triage to project board - name: Triage to project board
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9 uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
with: with:
action-token: ${{ secrets.GITHUB_TOKEN }} action-token: ${{ secrets.GITHUB_TOKEN }}
project-url: "https://github.com/github/docs/projects/1" project-url: 'https://github.com/github/docs/projects/1'
column-name: "Triage" column-name: 'Triage'

View File

@@ -1,7 +1,9 @@
name: Triage new pull requests name: Triage new pull requests
on: on:
pull_request: pull_request:
types: [reopened, opened] types:
- reopened
- opened
jobs: jobs:
triage_pulls: triage_pulls:
@@ -9,14 +11,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Label new pull requests with 'triage' - name: Label new pull requests with 'triage'
uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e uses: rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e
with: with:
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: '${{ secrets.GITHUB_TOKEN }}'
add-labels: "triage" add-labels: 'triage'
- name: Triage to project board - name: Triage to project board
uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9 uses: rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9
with: with:
action-token: ${{ secrets.GITHUB_TOKEN }} action-token: ${{ secrets.GITHUB_TOKEN }}
project-url: "https://github.com/github/docs/projects/1" project-url: 'https://github.com/github/docs/projects/1'
column-name: "Triage" column-name: 'Triage'

View File

@@ -1,7 +1,7 @@
name: Public Repo Stale Check name: Public Repo Stale Check
on: on:
schedule: schedule:
- cron: "45 16 * * *" # Run each day at 16:45 UTC / 8:45 PST - cron: '45 16 * * *' # Run each day at 16:45 UTC / 8:45 PST
jobs: jobs:
stale: stale:
@@ -9,10 +9,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4 - uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.' stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
days-before-stale: 7 days-before-stale: 7
days-before-close: 10 days-before-close: 10
stale-pr-label: 'stale' stale-pr-label: 'stale'
exempt-pr-labels: 'never-stale'
exempt-issue-labels: 'never-stale'

View File

@@ -0,0 +1,123 @@
name: Check unallowed file changes
on:
pull_request_target:
paths:
- '.github/workflows/**'
- '.github/CODEOWNERS'
- 'translations/**'
- 'assets/fonts/**'
- 'data/graphql/**'
- 'lib/graphql/**'
- 'lib/redirects/**'
- 'lib/rest/**'
- 'lib/webhooks/**'
jobs:
triage:
if: github.repository == 'github/docs' && github.event.pull_request.user.login != 'Octomerger'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Check for existing requested changes
id: requested-change
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: json
script: |
const pullReviews = await github.pulls.listReviews({
...context.repo,
pull_number: context.payload.number
})
const botReviews = pullReviews.data
.filter(review => review.user.login === 'github-actions[bot]')
.sort((a, b) => new Date(b.submitted_at) - new Date(a.submitted_at))
.shift()
if (botReviews) {
console.log(`Pull request reviews authored by the github-action bot: ${botReviews}`)
}
return botReviews
- name: Get files changed
uses: dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58
id: filter
with:
# Base branch used to get changed files
base: 'main'
# Enables setting an output in the format in `${FILTER_NAME}_files
# with the names of the matching files formatted as JSON array
list-files: json
# Returns list of changed files matching each filter
filters: |
translation:
- 'translations/**'
openapi:
- 'lib/rest/static/**'
notAllowed:
- '.github/workflows/**'
- '.github/CODEOWNERS'
- 'translations/**'
- 'assets/fonts/**'
- 'data/graphql/**'
- 'lib/graphql/**'
- 'lib/redirects/**'
- 'lib/rest/**'
- 'lib/webhooks/**'
# When there are changes to files we can't accept
# and no review exists,leave a REQUEST_CHANGES review
- name: Request pull request changes
# Check for no reviews or reviews that aren't CHANGES_REQUESTED
if: ${{ steps.filter.outputs.notAllowed == 'true' && (!steps.requested-change.outputs.result || fromJson(steps.requested-change.outputs.result).state != 'CHANGES_REQUESTED') }}
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const changedFiles = ${{steps.filter.outputs.notAllowed_files}}
const restFiles = ${{steps.filter.outputs.openapi_files}}
const translationFiles = ${{steps.filter.outputs.translation_files}}
const markdownFiles = changedFiles.map(file => `- \`${file}\`\n`).join('')
let reviewMessage = `👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions.\n${markdownFiles}\n\nYou'll need to revert all of these ☝️ files using [GitHub Desktop](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/reverting-a-commit) or \`git checkout origin/main <file name>\`. Once you get those files reverted, we can continue with the review process. :octocat:`
if (restFiles.length > 0) {
reviewMessage += "\n\nIt looks like you've modified the OpenAPI schema (`lib/rest/static/**`). While we aren't accepting changes to the schema directly, you can open an issue for any updates to the REST API docs. Head on over to the [`github/rest-api-description`](https://github.com/github/rest-api-description/issues/new?assignees=&labels=Inaccuracy&template=schema-inaccuracy.md&title=%5BSchema+Inaccuracy%5D+%3CDescribe+Problem%3E) repository to open an issue. ⚡"
}
if (translationFiles.length > 0) {
await github.issues.addLabels({
...context.repo,
issue_number: context.payload.number,
labels: ['localization']
})
reviewMessage += "\n\nIt looks like you've modified translated content. Unfortunately, we are not able to accept pull requests for translated content. Our translation process involves an integration with an external service at crowdin.com, where all translation activity happens. We hope to eventually open up the translation process to the open source community, but we're not there yet. See https://github.com/github/docs/blob/main/CONTRIBUTING.md#earth_asia-translations for more details."
}
await github.pulls.createReview({
...context.repo,
pull_number: context.payload.number,
body: reviewMessage,
event: 'REQUEST_CHANGES'
})
exit 1 # prevents further steps from running and fails workflow
# When the most recent review was CHANGES_REQUESTED and the existing
# PR no longer contains unallowed changes, dismiss the previous review
- name: Dismiss pull request review
# Check that unallowed files aren't modified and that a
# CHANGES_REQUESTED review already exists
if: ${{ steps.filter.outputs.notAllowed == 'false' && steps.requested-change.outputs.result && fromJson(steps.requested-change.outputs.result).state == 'CHANGES_REQUESTED' }}
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.pulls.dismissReview({
...context.repo,
pull_number: context.payload.number,
review_id: ${{fromJson(steps.requested-change.outputs.result).id}},
message: `✨Looks like you reverted all files we don't accept contributions for. 🙌 A member of the docs team will review your PR soon. 🚂`
})

View File

@@ -9,64 +9,61 @@ env:
FREEZE: ${{ secrets.FREEZE }} FREEZE: ${{ secrets.FREEZE }}
on: on:
workflow_dispatch:
schedule: schedule:
- cron: "20 16 * * *" # run every day at 16:20 UTC / 8:20 PST - cron: '20 16 * * *' # run every day at 16:20 UTC / 8:20 PST
jobs: jobs:
update_graphql_files: update_graphql_files:
if: github.repository == 'github/docs-internal' if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- if: ${{ env.FREEZE == 'true' }} - if: ${{ env.FREEZE == 'true' }}
run: | run: |
echo 'The repo is currently frozen! Exiting this workflow.' echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running exit 1 # prevents further steps from running
- name: Checkout - name: Checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Set up Ruby - name: Set up Ruby
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526 uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
with: with:
ruby-version: '2.4' ruby-version: '2.4'
- name: Install Ruby dependencies - name: Install Ruby dependencies
run: | run: |
gem install bundler gem install bundler
bundle install bundle install
- name: Install Node.js dependencies - name: Install Node.js dependencies
run: npm ci run: npm ci
- name: Run updater scripts - name: Run updater scripts
env: env:
# need to use a token from a user with access to github/github for this step # need to use a token from a user with access to github/github for this step
GITHUB_TOKEN: ${{ secrets.ZEKE_PAT_WITH_REPO_AND_WORKFLOW_SCOPE_FOR_REPO_SYNC }} GITHUB_TOKEN: ${{ secrets.RACHMARI_REPO_WORKFLOW }}
# technically the changelog should only be updated once per day, but we can safely run: |
# run build-changelog-from-markdown.js in its current form once per hour; when we script/graphql/update-files.js
# rewrite the changelog script, we may need to run it in a separate workflow on a - name: Create pull request
# once-per-day schedule; see details in https://github.com/github/docs-internal/issues/12722. id: create-pull-request
run: | uses: peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43
script/graphql/update-files.js with:
script/graphql/build-changelog-from-markdown.js # need to use a token with repo and workflow scopes for this step
- name: Create pull request token: ${{ secrets.GITHUB_TOKEN }}
id: create-pull-request commit-message: 'Action ran graphql script"update-files"'
uses: peter-evans/create-pull-request@938e6aea6f8dbdaced2064e948cb806c77fe87b8 title: GraphQL schema update
with: body:
# need to use a token with repo and workflow scopes for this step "Hello! Some GraphQL data in github/github was updated recently. This PR
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} syncs up the GraphQL data in this repo.\n\n
commit-message: 'Action ran graphql scripts "update-files" and "build-changelog-from-markdown"' If CI passes, this PR will be auto-merged. :green_heart:\n\n
title: GraphQL schema update If CI does not pass or other problems arise, contact #docs-engineering on slack."
body: "Hello! Some GraphQL data in github/github was updated recently. This PR labels: automerge
syncs up the GraphQL data in this repo.\n\n branch: graphql-schema-update
If CI passes, this PR will be auto-merged. :green_heart:\n\n - if: ${{ failure() }}
If CI does not pass or other problems arise, contact #docs-engineering on slack." name: Delete remote branch (if previous steps failed)
labels: automerge uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
branch: graphql-schema-update with:
- if: ${{ failure() }} github_token: ${{ secrets.GITHUB_TOKEN }}
name: Delete remote branch (if previous steps failed) branches: graphql-schema-update
uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911 - if: ${{ steps.create-pull-request.outputs.pr_number }}
with: name: Approve
github_token: ${{ secrets.GITHUB_TOKEN }} uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
branches: graphql-schema-update with:
- if: ${{ steps.create-pull-request.outputs.pr_number }} github-token: ${{ secrets.GITHUB_TOKEN }}
name: Approve number: ${{ steps.create-pull-request.outputs.pr_number }}
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create-pull-request.outputs.pr_number }}

22
.github/workflows/workflow-lint.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Lint workflows
on:
workflow_dispatch:
# push:
# branches:
# - main
# pull_request:
# branches-ignore:
# - translations
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Run linter
uses: cschleiden/actions-linter@43fd4e08e52ed40c0e2782dc2425694388851576
with:
workflows: '[".github/workflows/*.yml"]'

41
.github/workflows/yml-lint.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Lint Yaml
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches-ignore:
- translations
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Setup node
uses: actions/setup-node@56899e050abffc08c2b3b61f3ec6a79a9dc3223d
with:
node-version: 14.x
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Run linter
run: npx prettier -c "**/*.{yml,yaml}"

14
.gitignore vendored
View File

@@ -1,9 +1,17 @@
.algolia-cache .algolia-cache
.DS_Store .DS_Store
.env .env
node_modules /node_modules/
npm-debug.log npm-debug.log
coverage coverage/
.linkinator .linkinator
broken_links.md /assets/images/early-access
/content/early-access
/data/early-access
dist dist
# blc: broken link checker
blc_output.log
blc_output_internal.log
/dist/
broken_links.md

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
translations/

12
.prettierrc.json Normal file
View File

@@ -0,0 +1,12 @@
{
"overrides": [
{
"files":[
"**/*.{yml,yaml}"
],
"options": {
"singleQuote": true
}
}
]
}

13
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Node: Nodemon",
"processId": "${command:PickProcess}",
"restart": true,
"protocol": "inspector",
},
]
}

View File

@@ -22,6 +22,7 @@ Examples of unacceptable behavior include:
* Trolling, insulting or derogatory comments, and personal or political attacks * Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment * Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission * Publishing others' private information, such as a physical or email address, without their explicit permission
* Contacting individual members, contributors, or leaders privately, outside designated community mechanisms, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting * Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities

View File

@@ -114,7 +114,8 @@ You can browse existing issues to find something that needs help!
### Labels ### Labels
Labels can help you find an issue you'd like to help with. Labels can help you find an issue you'd like to help with.
- The [`good-first-issue` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Agood-first-issue) is for problems or updates we think are ideal for beginners. - The [`help wanted` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) is for problems or updates that anyone in the community can start working on.
- The [`good first issue` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) is for problems or updates we think are ideal for beginners.
- The [`content` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Acontent) is for problems or updates in the content on docs.github.com. These will usually require some knowledge of Markdown. - The [`content` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Acontent) is for problems or updates in the content on docs.github.com. These will usually require some knowledge of Markdown.
- The [`engineering` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Aengineering) is for problems or updates in the docs.github.com website. These will usually require some knowledge of JavaScript/Node.js or YAML to fix. - The [`engineering` label](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3Aengineering) is for problems or updates in the docs.github.com website. These will usually require some knowledge of JavaScript/Node.js or YAML to fix.
@@ -151,7 +152,7 @@ We (usually the docs team, but sometimes GitHub product managers, engineers, or
You should always review your own PR first. You should always review your own PR first.
For content changes, make sure that you: For content changes, make sure that you:
- [ ] Confirm that the changes address every part of the content strategy plan from your issue (if there are differences, explain them). - [ ] Confirm that the changes address every part of the content design plan from your issue (if there are differences, explain them).
- [ ] Review the content for technical accuracy. - [ ] Review the content for technical accuracy.
- [ ] Review the entire pull request using the [localization checklist](contributing/localization-checklist.md). - [ ] Review the entire pull request using the [localization checklist](contributing/localization-checklist.md).
- [ ] Copy-edit the changes for grammar, spelling, and adherence to the style guide. - [ ] Copy-edit the changes for grammar, spelling, and adherence to the style guide.

View File

@@ -10,10 +10,11 @@ GEM
PLATFORMS PLATFORMS
ruby ruby
x86_64-linux
DEPENDENCIES DEPENDENCIES
graphql (= 1.10.6) graphql (= 1.10.6)
graphql-schema_comparator (~> 1.0.0) graphql-schema_comparator (~> 1.0.0)
BUNDLED WITH BUNDLED WITH
2.1.4 2.2.1

View File

@@ -1 +1,3 @@
web: NODE_ENV=production node server.js web: NODE_ENV=production node server.js
release: NODE_ENV=production node script/purge-redis-pages.js

View File

@@ -5,6 +5,7 @@ This repository contains the documentation website code and Markdown source file
GitHub's Docs team works on pre-production content in a private repo that regularly syncs with this public repo. GitHub's Docs team works on pre-production content in a private repo that regularly syncs with this public repo.
In this article: In this article:
- [Contributing](#contributing) - [Contributing](#contributing)
- [READMEs](#readmes) - [READMEs](#readmes)
- [License](#license) - [License](#license)
@@ -17,7 +18,7 @@ We accept a lot of [different contributions](CONTRIBUTING.md/#types-of-contribut
#### Click **make a contribution** from docs #### Click **make a contribution** from docs
As you're using the GitHub Docs, you may find something in an article that you'd like to add to, update, or change. Click on **make a contribution** to navigate directly to that article in the codebase, so that you can begin making your contribution. As you're using GitHub Docs, you may find something in an article that you'd like to add to, update, or change. Click on **make a contribution** to navigate directly to that article in the codebase, so that you can begin making your contribution.
<img src="./assets/images/contribution_cta.png" width="400"> <img src="./assets/images/contribution_cta.png" width="400">
@@ -27,13 +28,14 @@ If you've found a problem, you can open an issue using a [template](https://gith
#### Solve an issue #### Solve an issue
If you have a solution to one of the open issues, you will need to fork the repository and submit a PR using the [template](https://github.com/github/docs/blob/main/CONTRIBUTING.md#pull-request-template) that is visible automatically in the pull request body. For more details about this process, please check out [Getting Started with Contributing](/CONTRIBUTING.md). If you have a solution to one of the open issues, you will need to fork the repository and submit a pull request using the [template](https://github.com/github/docs/blob/main/CONTRIBUTING.md#pull-request-template) that is visible automatically in the pull request body. For more details about this process, please check out [Getting Started with Contributing](/CONTRIBUTING.md).
#### Join us in discussions #### Join us in discussions
We use GitHub Discussions to talk about all sorts of topics related to documentation and this site. For example: if you'd like help troubleshooting a PR, have a great new idea, or want to share something amazing you've learned in our docs, join us in [discussions](https://github.com/github/docs/discussions). We use GitHub Discussions to talk about all sorts of topics related to documentation and this site. For example: if you'd like help troubleshooting a PR, have a great new idea, or want to share something amazing you've learned in our docs, join us in [discussions](https://github.com/github/docs/discussions).
#### And that's it! #### And that's it!
That's how you can get started easily as a member of the GitHub Documentation community. :sparkles: That's how you can get started easily as a member of the GitHub Documentation community. :sparkles:
If you want to know more, or you're making a more complex contribution, check out [Getting Started with Contributing](/CONTRIBUTING.md). If you want to know more, or you're making a more complex contribution, check out [Getting Started with Contributing](/CONTRIBUTING.md).
@@ -48,6 +50,8 @@ There are a few more things to know when you're getting started with this repo:
In addition to the README you're reading right now, this repo includes other READMEs that describe the purpose of each subdirectory in more detail: In addition to the README you're reading right now, this repo includes other READMEs that describe the purpose of each subdirectory in more detail:
- [content/README.md](content/README.md) - [content/README.md](content/README.md)
- [content/graphql/README.md](content/graphql/README.md)
- [content/rest/README.md](content/rest/README.md)
- [contributing/README.md](contributing/README.md) - [contributing/README.md](contributing/README.md)
- [data/README.md](data/README.md) - [data/README.md](data/README.md)
- [data/reusables/README.md](data/reusables/README.md) - [data/reusables/README.md](data/reusables/README.md)

View File

@@ -2,7 +2,8 @@
"name": "docs.github.com", "name": "docs.github.com",
"env": { "env": {
"NODE_ENV": "production", "NODE_ENV": "production",
"NPM_CONFIG_PRODUCTION": "true" "NPM_CONFIG_PRODUCTION": "true",
"ENABLED_LANGUAGES": "en"
}, },
"buildpacks": [ "buildpacks": [
{ "url": "heroku/nodejs" } { "url": "heroku/nodejs" }

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Some files were not shown because too many files have changed in this diff Show More