Skip to content

Commit bc47f60

Browse files
authored
Merge branch 'main' into patch-10
2 parents 037a22b + af7e3e8 commit bc47f60

File tree

55 files changed

+387
-138
lines changed

Some content is hidden

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

55 files changed

+387
-138
lines changed

.all-contributorsrc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,26 @@
358358
"contributions": [
359359
"code"
360360
]
361-
}
362-
],
361+
},
362+
{
363+
"login": "paulyhedral",
364+
"name": "Paul Schifferer",
365+
"avatar_url": "https://avatars1.githubusercontent.com/u/419457?v=4",
366+
"profile": "https://wanderingmonster.org",
367+
"contributions": [
368+
"content"
369+
]
370+
},
371+
{
372+
"login": "Protectator",
373+
"name": "Kewin Dousse",
374+
"avatar_url": "https://avatars3.githubusercontent.com/u/1529017?v=4",
375+
"profile": "https://www.kewindousse.ch",
376+
"contributions": [
377+
"content"
378+
]
379+
},
380+
{
363381
"contributorsPerLine": 7,
364382
"projectName": "docs",
365383
"projectOwner": "github",

.github/CODEOWNERS

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
# https://help.github.com/articles/about-codeowners
44
# https://git-scm.com/docs/gitignore
55

6-
/translations/ @github/docs-localization @github-actions
6+
# Engineering
77
*.js @github/docs-engineering
88
/.github/ @github/docs-engineering
99
/script/ @github/docs-engineering
1010
app.json @github/docs-engineering
11-
crowdin.yml @github/docs-engineering
1211
Dockerfile @github/docs-engineering
1312
package-lock.json @github/docs-engineering
1413
package.json @github/docs-engineering
1514

15+
# Localization
16+
/.github/workflows/crowdin.yml @github/docs-localization
17+
/crowdin*.yml @github/docs-engineering @github/docs-localization
18+
/translations/ @github/docs-engineering @github/docs-localization @github-actions
19+
20+
# Site Policy
1621
/content/github/site-policy/ @github/site-policy-admins
1722

1823
# Make sure that Octokit maintainers get notified about changes

.github/allowed-actions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = [
1818
'crowdin/github-action@1.0.10',
1919
'dawidd6/action-delete-branch@v3',
2020
'docker://chinthakagodawita/autoupdate-action:v1',
21+
'fkirc/skip-duplicate-actions@a12175f6209d4805b5a163d723270be2a0dc7b36',
2122
'github/codeql-action/analyze@v1',
2223
'github/codeql-action/init@v1',
2324
'ianwalter/puppeteer@3.0.0',

.github/workflows/browser-test.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
11
name: Browser Tests
22

3-
on: [push]
3+
on:
4+
workflow_dispatch:
5+
push:
46

57
jobs:
8+
see_if_should_skip:
9+
runs-on: ubuntu-latest
10+
# Map a step output to a job output
11+
outputs:
12+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
13+
steps:
14+
- id: skip_check
15+
uses: fkirc/skip-duplicate-actions@a12175f6209d4805b5a163d723270be2a0dc7b36
16+
with:
17+
cancel_others: 'false'
18+
github_token: ${{ github.token }}
19+
paths: '["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"]'
620
build:
21+
needs: see_if_should_skip
722
runs-on: ubuntu-latest
823
steps:
9-
- name: Checkout
24+
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
25+
# Even if if doesn't do anything
26+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
27+
name: Checkout
1028
uses: actions/checkout@v2
11-
- name: Install
29+
30+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
31+
name: Install
1232
uses: ianwalter/puppeteer@3.0.0
1333
with:
1434
args: npm ci
15-
- name: Test
35+
36+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
37+
name: Test
1638
uses: ianwalter/puppeteer@3.0.0
1739
with:
18-
args: npm run browser-test
40+
args: npm run browser-test

.github/workflows/crowdin.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
jobs:
1212
sync_with_crowdin:
1313
name: Sync with Crowdin
14+
if: github.repository == 'github/docs-internal'
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Checkout
@@ -19,7 +20,7 @@ jobs:
1920
- name: Sync
2021
uses: crowdin/github-action@1.0.10
2122
with:
22-
upload_translations: true
23+
upload_translations: false
2324
download_translations: true
2425
create_pull_request: true
2526

@@ -37,7 +38,7 @@ jobs:
3738
crowdin_branch_name: crowdin-main
3839

3940
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GITHUB_TOKEN: ${{ secrets.OCTOGLOT_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
4142

4243
# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string
4344
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: First responder docs-content
2+
on:
3+
pull_request:
4+
types: [reopened, opened, ready_for_review, unlabeled]
5+
6+
jobs:
7+
first-responder-triage:
8+
if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.event.action != 'unlabeled'
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check if the event originated from a team member
13+
uses: actions/github-script@v2.0.0
14+
id: set-result
15+
with:
16+
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
17+
result-encoding: string
18+
script: |
19+
const repoName = context.payload.repository.name
20+
const ownerName = context.payload.repository.owner.login
21+
const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number
22+
const updatedIssueInformation = await github.issues.get({
23+
owner: ownerName,
24+
repo: repoName,
25+
issue_number: issueNumber
26+
})
27+
const teamMembers = await github.request(
28+
`/orgs/github/teams/docs/members`
29+
)
30+
const logins = teamMembers.data.map(member => member.login)
31+
if (logins.some(login => login === updatedIssueInformation.data.user.login)) {
32+
console.log(`This issue or pull request was authored by a member of the github/docs team.`)
33+
return 'true'
34+
}
35+
console.log(`This issue or pull request was authored by an external contributor.`)
36+
return 'false'
37+
- name: Label external contributor pull requests with docs-content-fr
38+
uses: rachmari/labeler@v1.0.4
39+
if: steps.set-result.outputs.result == 'false'
40+
with:
41+
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}"
42+
add-labels: "docs-content-fr"
43+
- name: Triage to FR PR project column
44+
uses: rachmari/actions-add-new-issue-to-column@v1.1.1
45+
if: steps.set-result.outputs.result == 'false'
46+
with:
47+
action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
48+
project-url: "https://github.com/orgs/github/projects/1367"
49+
column-name: "Docs-internal external contributor PRs"
50+
51+
first-responder-label-removed:
52+
if: github.event.label.name == 'docs-content-fr' && github.event.action == 'unlabeled'
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Dump GitHub context
57+
env:
58+
GITHUB_CONTEXT: ${{ toJson(github) }}
59+
run: echo "$GITHUB_CONTEXT"
60+
- name: Remove card from project
61+
uses: actions/github-script@v2.0.0
62+
with:
63+
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
64+
result-encoding: string
65+
script: |
66+
const issueToRemove = context.payload.number
67+
const cards = await github.projects.listCards({
68+
column_id: 11130889
69+
})
70+
cards.data.forEach(card => {
71+
if (card.content_url) {
72+
const cardIssueNumber = parseInt(card.content_url.split('/').pop(), 10)
73+
if (cardIssueNumber === issueToRemove) {
74+
const cards = github.projects.deleteCard({
75+
card_id: card.id
76+
})
77+
}
78+
}
79+
})

.github/workflows/merged-notification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
on:
2-
pull_request:
2+
pull_request_target:
33
types: ['closed']
44

55
jobs:

.github/workflows/pa11y.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: "Pa11y"
2-
on: [push]
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "25 17 * * *" # once a day at 17:25 UTC / 11:50 PST
36
jobs:
47
test:
58
runs-on: ubuntu-latest

.github/workflows/test.yml

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

55
on:
6+
workflow_dispatch:
67
push:
78
branches:
89
- main
@@ -14,79 +15,110 @@ env:
1415
CI: true
1516

1617
jobs:
18+
see_if_should_skip:
19+
runs-on: ubuntu-latest
20+
# Map a step output to a job output
21+
outputs:
22+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
23+
steps:
24+
- id: skip_check
25+
uses: fkirc/skip-duplicate-actions@a12175f6209d4805b5a163d723270be2a0dc7b36
26+
with:
27+
cancel_others: 'false'
28+
github_token: ${{ github.token }}
29+
paths_ignore: '[".all-contributorsrc", ".env.example", ".gitattributes", ".vscode/**", "app.json", "assets/**", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "contributing/**", "crowdin-actions-config.yml", "crowdin.yml", "docs", "javascripts/**", "jest-puppeteer.config.js", "LICENSE-CODE", "LICENSE", "nodemon.json", "ownership.yaml", "README.md", "script/**", "stylesheets/**"]'
1730
lint:
31+
needs: see_if_should_skip
1832
runs-on: ubuntu-latest
1933
steps:
20-
- name: Check out repo
34+
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
35+
# Even if if doesn't do anything
36+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
37+
name: Check out repo
2138
uses: actions/checkout@v2
2239

23-
- name: Setup node
40+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
41+
name: Setup node
2442
uses: actions/setup-node@v1
2543
with:
2644
node-version: 14.x
2745

28-
- name: Get npm cache directory
46+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
47+
name: Get npm cache directory
2948
id: npm-cache
3049
run: |
3150
echo "::set-output name=dir::$(npm config get cache)"
3251
33-
- name: Cache node modules
52+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
53+
name: Cache node modules
3454
uses: actions/cache@v2
3555
with:
3656
path: ${{ steps.npm-cache.outputs.dir }}
3757
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
3858
restore-keys: |
3959
${{ runner.os }}-node-
4060
41-
- name: Install dependencies
61+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
62+
name: Install dependencies
4263
run: npm ci
4364

44-
- name: Run linter
65+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
66+
name: Run linter
4567
run: npx standard
4668

47-
- name: Check dependencies
69+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
70+
name: Check dependencies
4871
run: npm run check-deps
49-
5072
test:
73+
needs: see_if_should_skip
5174
runs-on: ubuntu-latest
5275
strategy:
5376
fail-fast: false
5477
matrix:
5578
test-group: [content, meta, rendering, routing, unit, links-and-images]
5679
steps:
57-
- name: Check out repo
80+
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
81+
# Even if if doesn't do anything
82+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
83+
name: Check out repo
5884
uses: actions/checkout@v2
5985

60-
- name: Setup node
86+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
87+
name: Setup node
6188
uses: actions/setup-node@v1
6289
with:
6390
node-version: 14.x
6491

65-
- name: Get npm cache directory
92+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
93+
name: Get npm cache directory
6694
id: npm-cache
6795
run: |
6896
echo "::set-output name=dir::$(npm config get cache)"
6997
70-
- name: Cache node modules
98+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
99+
name: Cache node modules
71100
uses: actions/cache@v2
72101
with:
73102
path: ${{ steps.npm-cache.outputs.dir }}
74103
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
75104
restore-keys: |
76105
${{ runner.os }}-node-
77106
78-
- name: Install dependencies
107+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
108+
name: Install dependencies
79109
run: npm ci
80110

81-
- name: Run build script
111+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
112+
name: Run build script
82113
run: npm run build
83114

84-
- name: Run tests
115+
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }}
116+
name: Run tests
85117
run: npx jest tests/${{ matrix.test-group }}/
86118

87119
- name: Send Slack notification if workflow fails
88120
uses: rtCamp/action-slack-notify@master
89121
if: failure() && github.ref == 'early-access'
90122
env:
91123
SLACK_WEBHOOK: ${{ secrets.DOCS_ALERTS_SLACK_WEBHOOK }}
92-
SLACK_MESSAGE: "Tests are failing on the `early-access` branch. https://github.com/github/docs-internal/tree/early-access"
124+
SLACK_MESSAGE: "Tests are failing on the `early-access` branch. https://github.com/github/docs-internal/tree/early-access"

0 commit comments

Comments
 (0)