Skip to content

Commit b26f74d

Browse files
author
Martin Lopes
authored
Merge branch 'main' into 5765-private-profile
2 parents 49e3d06 + 68400c5 commit b26f74d

File tree

2,021 files changed

+1365503
-883202
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,021 files changed

+1365503
-883202
lines changed

.devcontainer/devcontainer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
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
},
1717

18+
// Install features. Type 'feature' in the VS Code command palette for a full list.
19+
"features": {
20+
"git-lfs": "latest"
21+
},
22+
1823
// Visual Studio Code extensions which help authoring for docs.github.com.
1924
"extensions": [
2025
"dbaeumer.vscode-eslint",
@@ -29,8 +34,8 @@
2934
"forwardPorts": [4000],
3035

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

.github/actions-scripts/get-preview-app-info.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
[[ -z $APP_NAME_SEED ]] && { echo "Missing APP_NAME_SEED. Exiting."; exit 1; }
1414

1515
PREVIEW_ENV_LOCATION="eastus"
16-
echo "PREVIEW_ENV_LOCATION=${PREVIEW_ENV_LOCATION}" >> $GITHUB_ENV
1716

1817
REPO_NAME="${GITHUB_REPOSITORY#*\/}"
1918
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV
@@ -22,15 +21,14 @@ DEPLOYMENT_NAME="${REPO_NAME}-pr-${PR_NUMBER}"
2221
echo "DEPLOYMENT_NAME=${DEPLOYMENT_NAME}" >> $GITHUB_ENV
2322

2423
APP_NAME_BASE="${REPO_NAME}-preview-${PR_NUMBER}"
25-
echo "APP_NAME_BASE=${APP_NAME_BASE}" >> $GITHUB_ENV
2624

2725
# pseudo random string so guessing a preview env URL is more difficult
2826
APP_SHA=$(echo -n "${APP_NAME_SEED}-${APP_NAME_BASE}" | sha1sum | cut -c1-6)
2927

3028
APP_NAME="${APP_NAME_BASE}-${APP_SHA}"
3129
echo "APP_NAME=${APP_NAME}" >> $GITHUB_ENV
3230

33-
APP_URL="https://${APP_NAME}.${PREVIEW_ENV_LOCATION}.azurecontainer.io"
31+
APP_URL="https://${REPO_NAME}-${PR_NUMBER}-${APP_SHA}.preview.ghdocs.com"
3432
echo "APP_URL=${APP_URL}" >> $GITHUB_ENV
3533

3634
IMAGE_REPO="${GITHUB_REPOSITORY}/pr-${PR_NUMBER}"

.github/workflows/azure-preview-env-deploy.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,10 @@ jobs:
203203
template: ./azure-preview-env-template.json
204204
deploymentName: ${{ env.DEPLOYMENT_NAME }}
205205
parameters: appName="${{ env.APP_NAME }}"
206-
location="${{ env.PREVIEW_ENV_LOCATION }}"
207206
containerImage="${{ env.DOCKER_IMAGE }}"
208207
dockerRegistryUrl="${{ secrets.NONPROD_REGISTRY_SERVER }}"
209208
dockerRegistryUsername="${{ secrets.NONPROD_REGISTRY_USERNAME }}"
210209
dockerRegistryPassword="${{ secrets.NONPROD_REGISTRY_PASSWORD }}"
211-
storageAccountName="${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }}"
212-
storageAccountKey="${{ secrets.AZURE_STORAGE_ACCOUNT_KEY }}"
213210
# this shows warnings in the github actions console, because the flag is passed through a validation run,
214211
# but it *is* functional during the actual execution
215212
additionalArguments: --no-wait

.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/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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ jobs:
4848
- name: Check out repo
4949
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
5050
with:
51-
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' }}
5255
# Enables cloning the Early Access repo later with the relevant PAT
5356
persist-credentials: 'false'
5457

@@ -99,6 +102,8 @@ jobs:
99102
mv docs-early-access/data data/early-access
100103
rm -r docs-early-access
101104
105+
# This is necessary when LFS files where cloned but does nothing
106+
# if actions/checkout was run with `lfs:false`.
102107
- name: Checkout LFS objects
103108
run: git lfs checkout
104109

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