Skip to content

Commit baddb0f

Browse files
authored
Merge branch 'main' into patch-2
2 parents 4d419df + af4efa5 commit baddb0f

File tree

211 files changed

+1893
-1054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+1893
-1054
lines changed

.github/allowed-actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = [
1212
'actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526', //actions/setup-ruby@v1.1.2
1313
'actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4', //actions/stale@v3.0.13
1414
'crowdin/github-action@fd9429dd63d6c0f8a8cb4b93ad8076990bd6e688',
15-
'crykn/copy_folder_to_another_repo_action@abc264e1c16eb3d7b1f7763bfdb0e1699ad43120',
15+
'crykn/copy_folder_to_another_repo_action@0282e8b9fef06de92ddcae9fe6cb44df6226646c',
1616
'cschleiden/actions-linter@43fd4e08e52ed40c0e2782dc2425694388851576',
1717
'dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911',
1818
'docker://chinthakagodawita/autoupdate-action:v1',
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Check for External Repo Sync PR
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
branches:
9+
- main
10+
11+
jobs:
12+
invalid-repo-sync-check:
13+
name: Close external Repo Sync PRs
14+
if: ${{ github.repository == 'github/docs' && github.ref == 'refs/heads/repo-sync' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
18+
with:
19+
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
20+
script: |
21+
22+
const prCreator = context.payload.sender.login
23+
24+
// If the PR creator is the expected account, stop now
25+
if (prCreator === 'Octomerger') {
26+
return
27+
}
28+
29+
try {
30+
await github.teams.getMembershipForUserInOrg({
31+
org: 'github',
32+
team_slug: 'employees',
33+
username: prCreator
34+
})
35+
36+
// If the PR creator is a GitHub employee, stop now
37+
return
38+
} catch (err) {
39+
// An error will be thrown if the user is not a GitHub employee.
40+
// That said, we still want to proceed anyway!
41+
}
42+
43+
const pr = context.payload.pull_request
44+
const { owner, repo } = context.repo
45+
46+
// Close the PR and add the invalid label
47+
await github.issues.update({
48+
owner: owner,
49+
repo: repo,
50+
issue_number: pr.number,
51+
labels: ['invalid'],
52+
state: 'closed'
53+
})
54+
55+
// Comment on the PR
56+
await github.issues.createComment({
57+
owner: owner,
58+
repo: repo,
59+
issue_number: pr.number,
60+
body: "Please leave this `repo-sync` branch to the robots!\n\nI'm going to close this pull request now, but feel free to open a new issue or ask any questions in [discussions](https://github.com/github/docs/discussions)!"
61+
})
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 'Link Checker: Dotcom'
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
see_if_should_skip:
9+
continue-on-error: true
10+
runs-on: ubuntu-latest
11+
# Map a step output to a job output
12+
outputs:
13+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
14+
steps:
15+
- id: skip_check
16+
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
17+
with:
18+
cancel_others: 'false'
19+
github_token: ${{ github.token }}
20+
paths: '[".github/workflows/link-check-dotcom.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"]'
21+
build:
22+
needs: see_if_should_skip
23+
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
24+
steps:
25+
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
26+
# Even if if doesn't do anything
27+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
28+
name: Checkout
29+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
30+
31+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
32+
name: Setup node
33+
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
34+
with:
35+
node-version: 14.x
36+
37+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
38+
name: Install
39+
run: npm ci
40+
41+
## TODO
42+
# - if: ${{ github.repository == 'github/docs-internal' && needs.see_if_should_skip.outputs.should_skip != 'true' }}
43+
# name: Clone early access
44+
# run: npm run heroku-postbuild
45+
# env:
46+
# DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
47+
# GIT_BRANCH: ${{ github.ref }}
48+
49+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
50+
name: Build
51+
run: npm run build
52+
53+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
54+
name: 'Link check: Dotcom'
55+
env:
56+
DOCS_VERSION: 'dotcom'
57+
run: npm run link-check

.github/workflows/link-check-test.yml renamed to .github/workflows/link-check-ghae.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Link Checker
1+
name: 'Link Checker: GitHub AE'
22

33
on:
44
workflow_dispatch:
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
cancel_others: 'false'
1919
github_token: ${{ github.token }}
20-
paths: '[".github/workflows/link-check-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"]'
20+
paths: '[".github/workflows/link-check-ghae.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"]'
2121
build:
2222
needs: see_if_should_skip
2323
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
@@ -51,5 +51,7 @@ jobs:
5151
run: npm run build
5252

5353
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
54-
name: Link check
54+
name: 'Link check: GitHub AE'
55+
env:
56+
DOCS_VERSION: 'github-ae'
5557
run: npm run link-check

.github/workflows/link-check-ghes.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 'Link Checker: Enterprise Server'
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
see_if_should_skip:
9+
continue-on-error: true
10+
runs-on: ubuntu-latest
11+
# Map a step output to a job output
12+
outputs:
13+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
14+
steps:
15+
- id: skip_check
16+
uses: fkirc/skip-duplicate-actions@36feb0d8d062137530c2e00bd278d138fe191289
17+
with:
18+
cancel_others: 'false'
19+
github_token: ${{ github.token }}
20+
paths: '[".github/workflows/link-check-ghes.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"]'
21+
build:
22+
needs: see_if_should_skip
23+
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
24+
steps:
25+
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
26+
# Even if if doesn't do anything
27+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
28+
name: Checkout
29+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
30+
31+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
32+
name: Setup node
33+
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
34+
with:
35+
node-version: 14.x
36+
37+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
38+
name: Install
39+
run: npm ci
40+
41+
## TODO
42+
# - if: ${{ github.repository == 'github/docs-internal' && needs.see_if_should_skip.outputs.should_skip != 'true' }}
43+
# name: Clone early access
44+
# run: npm run heroku-postbuild
45+
# env:
46+
# DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
47+
# GIT_BRANCH: ${{ github.ref }}
48+
49+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
50+
name: Build
51+
run: npm run build
52+
53+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}
54+
name: 'Link check: Enterprise Server'
55+
env:
56+
DOCS_VERSION: 'enterprise-server'
57+
run: npm run link-check

.github/workflows/site-policy-sync.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ jobs:
2929

3030
# Pushes to other repo
3131
- name: Push folder to another repository
32-
uses: crykn/copy_folder_to_another_repo_action@abc264e1c16eb3d7b1f7763bfdb0e1699ad43120
32+
uses: crykn/copy_folder_to_another_repo_action@0282e8b9fef06de92ddcae9fe6cb44df6226646c
3333
env:
3434
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_SITEPOLICY }}
3535
with:
3636
source_folder: 'content/github/site-policy'
3737
destination_repo: 'github/site-policy'
38-
destination_branch: 'repo-sync'
38+
destination_branch: 'main'
39+
destination_branch_create: 'repo-sync'
3940
destination_folder: 'Policies'
4041
user_email: 'pcihon@users.noreply.github.com'
4142
user_name: 'pcihon'

.github/workflows/test-translations.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: Node.js Tests - Translations
44

55
on:
6+
workflow_dispatch:
67
schedule:
78
- cron: '10 20 * * *' # once a day at 20:10 UTC / 12:10 PST
89

@@ -16,6 +17,9 @@ jobs:
1617
with:
1718
ref: translations # check out the 'translations' branch
1819

20+
- name: Check out tip of main
21+
run: git fetch --depth=1 origin main
22+
1923
- name: Setup node
2024
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
2125
with:
@@ -40,6 +44,9 @@ jobs:
4044
- name: Run linter
4145
run: npx eslint .
4246

47+
- name: Lint translated content
48+
run: npm run lint-translation
49+
4350
- name: Check dependencies
4451
run: npm run check-deps
4552

@@ -75,6 +82,9 @@ jobs:
7582
- name: Install dependencies
7683
run: npm ci
7784

85+
- name: Run build script
86+
run: npm run build
87+
7888
- name: Run tests
7989
run: npx jest tests/${{ matrix.test-group }}/
8090
env:

.github/workflows/triage-unallowed-contributions.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,23 @@ jobs:
7878
with:
7979
github-token: ${{secrets.GITHUB_TOKEN}}
8080
script: |
81-
const changedFiles = ${{steps.filter.outputs.notAllowed_files}}
82-
const restFiles = ${{steps.filter.outputs.openapi_files}}
83-
const translationFiles = ${{steps.filter.outputs.translation_files}}
84-
const markdownFiles = changedFiles.map(file => `- \`${file}\`\n`).join('')
81+
const badFilesArr = [
82+
'translations/**',
83+
'lib/rest/static/**',
84+
'.github/workflows/**',
85+
'.github/CODEOWNERS',
86+
'translations/**',
87+
'assets/fonts/**',
88+
'data/graphql/**',
89+
'lib/graphql/**',
90+
'lib/redirects/**',
91+
'lib/rest/**',
92+
'lib/webhooks/**'
93+
]
8594
86-
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:`
95+
const badFiles = badFilesArr.join('\n')
8796
88-
if (restFiles.length > 0) {
89-
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. ⚡"
90-
}
91-
92-
if (translationFiles.length > 0) {
93-
await github.issues.addLabels({
94-
...context.repo,
95-
issue_number: context.payload.number,
96-
labels: ['localization']
97-
})
98-
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."
99-
}
97+
let reviewMessage = `👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions. The complete list of files we can't accept are:\n${badFiles}\n\nYou'll need to revert all of the files you changed in that list 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:`
10098
10199
await github.pulls.createReview({
102100
...context.repo,
25.1 KB
Loading
-2.16 KB
Loading

0 commit comments

Comments
 (0)