Skip to content

Commit 75b79f6

Browse files
authored
Merge branch 'main' into patch-2
2 parents 77fe55a + 0be600b commit 75b79f6

File tree

2,041 files changed

+33556
-26556
lines changed

Some content is hidden

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

2,041 files changed

+33556
-26556
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111

1212
// Set *default* container specific settings.json values on container create.
13-
"settings": {
13+
"settings": {
1414
"terminal.integrated.shell.linux": "/bin/bash",
1515
"cSpell.language": ",en"
1616
},
@@ -34,8 +34,8 @@
3434
"forwardPorts": [4000],
3535

3636
// Use 'postCreateCommand' to run commands after the container is created.
37-
"postCreateCommand": "npm ci && npm run build",
38-
37+
"postCreateCommand": "git lfs pull && npm ci",
38+
3939
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
4040
"remoteUser": "node"
4141

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "test",
3+
4+
"settings": {
5+
"terminal.integrated.shell.linux": "/bin/csh",
6+
},
7+
8+
// Visual Studio Code extensions which help authoring for docs.github.com.
9+
"extensions": [
10+
"dbaeumer.vscode-eslint",
11+
"sissel.shopify-liquid"
12+
],
13+
14+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
"forwardPorts": [5000],
16+
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
"postCreateCommand": "echo test > aaa-TEST.txt"
19+
20+
}

.github/workflows/main-preview-docker-cache.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ concurrency:
2020

2121
jobs:
2222
build-and-push-nonprod-cache:
23+
if: ${{ github.repository == 'github/docs-internal' || github.repository == 'github/docs' }}
2324
runs-on: ubuntu-latest
2425
timeout-minutes: 15
2526
env:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Stale check for issues or PRs with "needs SME" label
2+
3+
# **What it does**: Provides stale checks on issues/PRs that need SME(subject matter expert) review on open source docs repo.
4+
# **Why we have it**: In the open repo, we want we want frequent checks on issues/PRs that are waiting on SME review.
5+
# **Who does it impact**: Anyone working in the open repo.
6+
7+
on:
8+
schedule:
9+
- cron: '40 20 * * *' # Run each day at 20:40 UTC / 12:40 PST
10+
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
stale_needs-sme:
17+
if: ${{ github.repository == 'github/docs'' }}
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/stale@7fb802b3079a276cf3c7e6ba9aa003c665b3f838
22+
with:
23+
only-labels: needs SME
24+
remove-stale-when-updated: true
25+
days-before-stale: 7 # adds stale label if no activity for 7 days
26+
stale-issue-message: 'This is a gentle bump for the docs team that this issue is waiting for technical review.'
27+
stale-issue-label: SME stale
28+
days-before-issue-close: -1 # never close
29+
stale-pr-message: 'This is a gentle bump for the docs team that this PR is waiting for technical review.'
30+
stale-pr-label: SME stale
31+
days-before-pr-close: -1 # never close
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Comment on adding "needs SME" label
2+
3+
# **What it does**: Comment on issues and pull requests when a "needs SME" label is added. SME = subject matter expert.
4+
# **Why we have it**: We want to manage our queue of issues and pull requests that need sme review.
5+
# **Who does it impact**: Everyone that works on docs or docs-internal.
6+
7+
on:
8+
issues:
9+
types: [labeled]
10+
pull_request_target:
11+
types: [labeled]
12+
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
17+
jobs:
18+
add-comment:
19+
if: ${{ github.repository == 'github/docs' && (github.event.label.name == 'needs SME' && github.event_name == 'issues' || github.event_name == 'pull_request_target') }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
23+
with:
24+
issue-number: ${{ github.event.issue.number }}
25+
body: |
26+
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:
27+
- uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
28+
with:
29+
issue-number: ${{ github.event.pull_request_target.number }}
30+
body: |
31+
Thanks for opening a pull request! We've triaged this issue for technical review by a subject matter expert :eyes:

.github/workflows/optimize-images.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ permissions:
1616

1717
jobs:
1818
optimize-images-on-pr:
19-
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
19+
# We can't make commits on forks
20+
if: github.repository == 'github/docs-internal'
2021
runs-on: ubuntu-latest
2122
steps:
2223
- name: Check out repo on head ref

.github/workflows/orphaned-assets-check.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ name: 'Orphaned assets check'
55
# **Who does it impact**: Docs content.
66

77
on:
8-
pull_request:
9-
push:
10-
branches:
11-
- gh-readonly-queue/main/**
8+
workflow_dispatch:
9+
schedule:
10+
- cron: '13 10 * * *' # Once a day at 10:13 UTC
1211

1312
permissions:
1413
contents: read
1514

1615
jobs:
1716
orphaned-assets-check:
17+
if: ${{ github.repository == 'github/docs-internal' }}
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
22+
with:
23+
# Using a PAT is necessary so that the new commit will trigger the
24+
# CI in the PR. (Events from GITHUB_TOKEN don't trigger new workflows.)
25+
token: ${{ secrets.DOCUBOT_REPO_PAT }}
2226

2327
- name: Setup node
2428
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
@@ -30,4 +34,30 @@ jobs:
3034
run: npm ci
3135

3236
- name: Check for orphaned assets
33-
run: ./script/find-orphaned-assets.mjs --verbose --exit
37+
env:
38+
# Needed for gh
39+
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
40+
run: |
41+
set -e
42+
43+
./script/find-orphaned-assets.mjs | xargs git rm
44+
45+
# If nothing to commit, exit now. It's fine. No orphans.
46+
git status | grep 'nothing to commit' && exit 0
47+
48+
# Replicated from the translation pipeline PR-maker Action
49+
git config --global user.name "docubot"
50+
git config --global user.email "[email protected]"
51+
52+
date=$(date '+%Y-%m-%d-%H-%M')
53+
branchname=orphaned-assets-$date-$GITHUB_RUN_ID
54+
55+
git checkout -b $branchname
56+
git commit -m "Delete orphaned assets $date"
57+
git push origin $branchname
58+
59+
gh pr create \
60+
--title "Delete orphaned assets ($date)" \
61+
--body "Found with the find-orphaned-assets.mjs script" \
62+
--repo github/docs-internal \
63+
--label docs-content-fr

.github/workflows/sync-search-indices.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ jobs:
7777
env:
7878
VERSION: ${{ github.event.inputs.version }}
7979
LANGUAGE: ${{ github.event.inputs.language }}
80+
# We don't want or need the changelog entries in this context.
81+
# Pages that display the content from these isn't included
82+
# in search index bodies anyway.
83+
CHANGELOG_DISABLED: true
84+
# If a reusable, or anything in the `data/*` directory is deleted
85+
# you might get a
86+
#
87+
# RenderError: Can't find the key 'site.data.reusables...' in the scope
88+
#
89+
# But that'll get fixed in the next translation pipeline. For now,
90+
# let's just accept an empty string instead.
91+
THROW_ON_EMPTY: false
8092
run: npm run sync-search
8193

8294
- name: Update private docs repository search indexes

.github/workflows/test.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
# The same array lives in test-windows.yml, so make any updates there too.
34-
test-group: [
34+
test-group:
35+
[
3536
content,
3637
graphql,
3738
meta,
3839
rendering,
3940
routing,
4041
unit,
41-
# linting,
42+
linting,
4243
translations,
4344
]
4445
steps:
@@ -47,7 +48,10 @@ jobs:
4748
- name: Check out repo
4849
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
4950
with:
50-
lfs: true
51+
# Not all test suites need the LFS files. So instead, we opt to
52+
# NOT clone them initially and instead, include them manually
53+
# only for the test groups that we know need the files.
54+
lfs: ${{ matrix.test-group == 'content' }}
5155
# Enables cloning the Early Access repo later with the relevant PAT
5256
persist-credentials: 'false'
5357

@@ -98,23 +102,25 @@ jobs:
98102
mv docs-early-access/data data/early-access
99103
rm -r docs-early-access
100104
105+
# This is necessary when LFS files where cloned but does nothing
106+
# if actions/checkout was run with `lfs:false`.
101107
- name: Checkout LFS objects
102108
run: git lfs checkout
103109

104-
# - name: Gather files changed
105-
# uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b
106-
# id: get_diff_files
107-
# with:
108-
# # So that `steps.get_diff_files.outputs.files` becomes
109-
# # a string like `foo.js path/bar.md`
110-
# output: ' '
110+
- name: Gather files changed
111+
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b
112+
id: get_diff_files
113+
with:
114+
# So that `steps.get_diff_files.outputs.files` becomes
115+
# a string like `foo.js path/bar.md`
116+
output: ' '
111117

112-
# - name: Insight into changed files
113-
# run: |
118+
- name: Insight into changed files
119+
run: |
114120
115-
# # Must to do this because the list of files can be HUGE. Especially
116-
# # in a repo-sync when there are lots of translation files involved.
117-
# echo "${{ steps.get_diff_files.outputs.files }}" > get_diff_files.txt
121+
# Must to do this because the list of files can be HUGE. Especially
122+
# in a repo-sync when there are lots of translation files involved.
123+
echo "${{ steps.get_diff_files.outputs.files }}" > get_diff_files.txt
118124
119125
- name: Setup node
120126
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
@@ -136,6 +142,6 @@ jobs:
136142

137143
- name: Run tests
138144
env:
139-
# DIFF_FILE: get_diff_files.txt
145+
DIFF_FILE: get_diff_files.txt
140146
CHANGELOG_CACHE_FILE_PATH: tests/fixtures/changelog-feed.json
141147
run: npm test -- tests/${{ matrix.test-group }}/

.github/workflows/triage-stale-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
stale-issue-message: 'A stale label has been added to this issue becuase it has been open for 60 days with no activity. To keep this issue open, add a comment within 3 days.'
2525
days-before-issue-stale: 60
2626
days-before-issue-close: 3
27-
exempt-issue-labels: 'help wanted,waiting for review'
27+
exempt-issue-labels: 'help wanted,never-stale,waiting for review'
2828
stale-pr-message: 'A stale label has been added to this pull request because it has been open 7 days with no activity. To keep this PR open, add a comment or push a commit within 3 days.'
2929
days-before-pr-stale: 7
3030
days-before-pr-close: 3

0 commit comments

Comments
 (0)