Skip to content

Commit 7fdffd8

Browse files
authored
Merge branch 'main' into patch-2
2 parents 2eb3c09 + 65c8204 commit 7fdffd8

File tree

1,352 files changed

+356974
-186453
lines changed

Some content is hidden

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

1,352 files changed

+356974
-186453
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/.github/ @github/docs-engineering
1111
/script/ @github/docs-engineering
1212
/includes/ @github/docs-engineering
13-
/lib/search/popular-pages.json @github/docs-engineering
1413
Dockerfile @github/docs-engineering
1514
package-lock.json @github/docs-engineering
1615
package.json @github/docs-engineering

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Thank you for contributing to this project! You must fill out the information be
44

55
### Why:
66

7-
Closes ISSUE
7+
Closes:
88

9-
<!-- If there's an existing issue for your change, please replace ISSUE above with a link to the issue.
9+
<!-- If there's an existing issue for your change, please link to it above.
1010
If there's _not_ an existing issue, please open one first to make it more likely that this update will be accepted: https://github.com/github/docs/issues/new/choose. -->
1111

1212
### What's being changed (if available, include any code snippets, screenshots, or gifs):

.github/actions/clone-translations/action.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ runs:
1717
token: ${{ inputs.token }}
1818
path: translations/zh-cn
1919

20-
- name: Clone Japanese
21-
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
22-
with:
23-
repository: github/docs-internal.ja-jp
24-
token: ${{ inputs.token }}
25-
path: translations/ja-jp
26-
2720
- name: Clone Spanish
2821
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
2922
with:
@@ -38,12 +31,19 @@ runs:
3831
token: ${{ inputs.token }}
3932
path: translations/pt-br
4033

41-
- name: Clone German
34+
- name: Clone Russian
4235
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
4336
with:
44-
repository: github/docs-internal.de-de
37+
repository: github/docs-internal.ru-ru
4538
token: ${{ inputs.token }}
46-
path: translations/de-de
39+
path: translations/ru-ru
40+
41+
- name: Clone Japanese
42+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
43+
with:
44+
repository: github/docs-internal.ja-jp
45+
token: ${{ inputs.token }}
46+
path: translations/ja-jp
4747

4848
- name: Clone French
4949
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
@@ -52,12 +52,12 @@ runs:
5252
token: ${{ inputs.token }}
5353
path: translations/fr-fr
5454

55-
- name: Clone Russian
55+
- name: Clone German
5656
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
5757
with:
58-
repository: github/docs-internal.ru-ru
58+
repository: github/docs-internal.de-de
5959
token: ${{ inputs.token }}
60-
path: translations/ru-ru
60+
path: translations/de-de
6161

6262
- name: Clone Korean
6363
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

.github/workflows/local-dev.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Local development
2+
3+
# **What it does**: Can you start the local server like a writer would do?
4+
# **Why we have it**: Our CI is often heavily geared on testing in "production"
5+
# that historically we've been known to break local
6+
# development sometimes.
7+
# **Who does it impact**: Engineers, Contributors.
8+
9+
on:
10+
merge_group:
11+
pull_request:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
local-dev:
18+
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
19+
runs-on: ${{ fromJSON('["ubuntu-latest", "ubuntu-20.04-xl"]')[github.repository == 'github/docs-internal'] }}
20+
steps:
21+
- name: Check out repo
22+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
23+
24+
- uses: ./.github/actions/node-npm-setup
25+
26+
# Note that we don't check out docs-early-access, Elasticsearch,
27+
# or any remote translations. Nothing fancy here!
28+
29+
- name: Start server in the background
30+
run: npm start > /tmp/stdout.log 2> /tmp/stderr.log &
31+
32+
- name: View the home page
33+
run: |
34+
echo "Going to sleep a little to wait for the server to start"
35+
sleep 10
36+
curl --fail --retry-connrefused --retry 5 http://localhost:4000/
37+
38+
- name: Edit a page's .md file and expect it to appear
39+
run: |
40+
# First append anything to the Markdown page
41+
echo "Today's date $(date)" >> content/get-started/quickstart/hello-world.md
42+
43+
# This pipe to grep will fail if it can't find it in the curl output
44+
curl -L http://localhost:4000/get-started/quickstart/hello-world | grep "Today's date"
45+
46+
- if: ${{ failure() }}
47+
name: Debug server outputs on errors
48+
run: |
49+
echo "____STDOUT____"
50+
cat /tmp/stdout.log
51+
echo "____STDERR____"
52+
cat /tmp/stderr.log

.github/workflows/needs-sme-stale-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
21+
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84
2222
with:
2323
only-labels: needs SME
2424
remove-stale-when-updated: true

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
20+
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84
2121
with:
2222
repo-token: ${{ secrets.GITHUB_TOKEN }}
2323
stale-issue-message: 'This issue is stale because there have been no updates in 365 days.'
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Sync CodeQl CLI
2+
3+
# **What it does**: This workflow is run manually approximately every two weeks.
4+
# When run, this workflow syncs the CodeQL CLI automated pipeline with the semmle-code
5+
# repository, and creates a pull request if there are updates.
6+
# **Why we have it**: So we can automate CodeQL CLI documentation.
7+
# **Who does it impact**: Anyone making CodeQL CLI changes in `github/semmle-code`, and wanting to get them published on the docs site.
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
SOURCE_BRANCH:
13+
description: 'Branch to pull the source files from in the semmle-code repo.'
14+
type: string
15+
required: true
16+
default: 'main'
17+
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
22+
# This allows a subsequently queued workflow run to interrupt previous runs
23+
concurrency:
24+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
25+
cancel-in-progress: true
26+
27+
jobs:
28+
generate-codeql-files:
29+
if: github.repository == 'github/docs-internal'
30+
runs-on: ubuntu-latest
31+
steps:
32+
- if: ${{ env.FREEZE == 'true' }}
33+
run: |
34+
echo 'The repo is currently frozen! Exiting this workflow.'
35+
exit 1 # prevents further steps from running
36+
37+
- name: Checkout repository code
38+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
39+
40+
# Check out a nested repository inside of previous checkout
41+
- name: Checkout semmle-code repo
42+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
43+
with:
44+
# By default, only the most recent commit of the `main` branch
45+
# will be checked out
46+
token: ${{ secrets.DOCS_BOT_FR }}
47+
repository: github/semmle-code
48+
path: semmle-code
49+
ref: ${{ github.event.inputs.SOURCE_BRANCH }}
50+
51+
- uses: ./.github/actions/node-npm-setup
52+
53+
- name: Get the semmle-code SHA being synced
54+
id: semmle-code
55+
run: |
56+
cd semmle-code
57+
OPENAPI_COMMIT_SHA=$(git rev-parse HEAD)
58+
echo "OPENAPI_COMMIT_SHA=$OPENAPI_COMMIT_SHA" >> $GITHUB_OUTPUT
59+
echo "Copied files from github/semmle-code repo. Commit SHA: $OPENAPI_COMMIT_SHA"
60+
61+
- name: Install pandoc
62+
run: |
63+
# Remove all previous pandoc versions
64+
sudo apt-get purge --auto-remove pandoc
65+
# Download pandoc
66+
wget https://github.com/jgm/pandoc/releases/download/3.0.1/pandoc-3.0.1-1-amd64.deb
67+
# Install pandoc
68+
sudo dpkg -i pandoc-3.0.1-1-amd64.deb
69+
# Output the pandoc version installed
70+
pandoc -v
71+
rm pandoc-3.0.1-1-amd64.deb
72+
73+
- name: Sync the CodeQL CLI data
74+
run: |
75+
src/codeql-cli/scripts/sync.js
76+
git status
77+
echo "Deleting the cloned github/semmle-code repo..."
78+
rm -rf semmle-code
79+
80+
- name: Create pull request
81+
env:
82+
# Needed for gh
83+
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
84+
run: |
85+
# If nothing to commit, exit now. It's fine. No orphans.
86+
changes=$(git diff --name-only | wc -l)
87+
untracked=$(git status --untracked-files --short | wc -l)
88+
if [[ $changes -eq 0 ]] && [[ $untracked -eq 0 ]]; then
89+
echo "There are no changes to commit after running src/codeql/scripts/sync.js. Exiting..."
90+
exit 0
91+
fi
92+
93+
git config --global user.name "docubot"
94+
git config --global user.email "[email protected]"
95+
96+
branchname=codeql-cli-update-${{ steps.semmle-code.outputs.OPENAPI_COMMIT_SHA }}
97+
98+
branchCheckout=$(git checkout -b $branchname)
99+
if [[! $? -eq 0 ]]; then
100+
echo "Branch $branchname already exists in `github/docs-internal`. Exiting..."
101+
exit 0
102+
fi
103+
git add .
104+
git commit -m "Update CodeQL CLI data"
105+
git push origin $branchname
106+
107+
echo "Creating pull request..."
108+
gh pr create \
109+
--title "Update CodeQL CLI manual" \
110+
--body '👋 humans. This PR updates the CodeQL CLI manual Markdown pages with the latest changes. (Synced from semmle-code@${{ steps.semmle-code.outputs.OPENAPI_COMMIT_SHA }})
111+
112+
If CI does not pass or other problems arise, contact #docs-engineering on slack.' \
113+
--repo github/docs-internal \
114+
--label codeql-cli-pipeline
115+
116+
- name: Send Slack notification if workflow fails
117+
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
118+
if: ${{ failure() && env.FREEZE != 'true' }}
119+
with:
120+
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
121+
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
122+
color: failure
123+
text: The last Sync CodeQL CLI run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/sync-codeql-cli.yml

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
script: |
4949
// Edit this list for the definitive list of languages
5050
// (other than English) we want to index in Elasticsearch.
51-
const allNonEnglish = ["ja", "es", "pt", "zh", "ru", "fr", "ko", "de"]
51+
const allNonEnglish = ["zh", "es", "pt", "ru", "ja", "fr", "de", "ko"]
5252
const allPossible = ["en", ...allNonEnglish]
5353
5454
if (context.eventName === "workflow_run") {
@@ -99,6 +99,14 @@ jobs:
9999
- name: Check out repo
100100
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
101101

102+
- name: Clone docs-internal.popular-pages
103+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
104+
with:
105+
repository: github/docs-internal.popular-pages
106+
# This works because user `docubot` has read access to that private repo.
107+
token: ${{ secrets.DOCUBOT_REPO_PAT }}
108+
path: popular-pages
109+
102110
- name: Clone all translations
103111
if: ${{ matrix.language != 'en' }}
104112
uses: ./.github/actions/clone-translations
@@ -149,6 +157,10 @@ jobs:
149157
# the same as not set within the script.
150158
VERSION: ${{ github.event.inputs.version }}
151159

160+
# The sync-search-index recognizes this env var if you don't
161+
# use the `--popular-pags <PATH>` option.
162+
POPULAR_PAGES_JSON: popular-pages/records/popular-pages.json
163+
152164
run: |
153165
mkdir /tmp/records
154166
npm run sync-search-indices -- /tmp/records \

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
paths:
1111
- 'script/search/**'
1212
- 'package*.json'
13-
- lib/search/popular-pages.json
1413
# Ultimately, for debugging this workflow itself
1514
- .github/workflows/sync-search-pr.yml
1615

@@ -36,6 +35,14 @@ jobs:
3635
- name: Check out repo
3736
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
3837

38+
- name: Clone docs-internal.popular-pages
39+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
40+
with:
41+
repository: github/docs-internal.popular-pages
42+
# This works because user `docubot` has read access to that private repo.
43+
token: ${{ secrets.DOCUBOT_REPO_PAT }}
44+
path: popular-pages
45+
3946
- uses: ./.github/actions/setup-elasticsearch
4047

4148
- uses: ./.github/actions/node-npm-setup
@@ -78,6 +85,10 @@ jobs:
7885
# let's just accept an empty string instead.
7986
THROW_ON_EMPTY: false
8087

88+
# The sync-search-index recognizes this env var if you don't
89+
# use the `--popular-pags <PATH>` option.
90+
POPULAR_PAGES_JSON: popular-pages/records/popular-pages.json
91+
8192
run: |
8293
mkdir /tmp/records
8394
npm run sync-search-indices -- /tmp/records \

0 commit comments

Comments
 (0)