Skip to content

Commit 819008e

Browse files
Merge branch 'main' into patch-1
2 parents 147397b + f2fc65b commit 819008e

File tree

377 files changed

+24327
-18157
lines changed

Some content is hidden

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

377 files changed

+24327
-18157
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# To find available Node images, see https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
2-
3-
# [Choice] Node.js version
4-
ARG VARIANT="dev-24-bullseye"
5-
FROM mcr.microsoft.com/devcontainers/javascript-node:${VARIANT}
2+
ARG VARIANT=dev-24-bullseye
3+
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bullseye@sha256:3502f1f21b1989500e8c72ada7d6e496dc4540b0707d4ea4ff743077f88a6c2d

.github/workflows/index-general-search.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ on:
2626
permissions:
2727
contents: read
2828

29-
# This allows a subsequently queued workflow run to cancel previous runs
29+
# This allows a subsequently queued workflow run to cancel previous runs.
30+
# Include the triggering workflow's conclusion in the group so that runs triggered
31+
# by skipped Purge Fastly workflows don't cancel runs triggered by successful ones.
3032
concurrency:
31-
group: '${{ github.workflow }} @ ${{ github.head_ref }} ${{ github.event_name }}'
33+
group: '${{ github.workflow }} @ ${{ github.head_ref }} ${{ github.event_name }} ${{ github.event.workflow_run.conclusion }}'
3234
cancel-in-progress: true
3335

3436
env:
@@ -40,7 +42,9 @@ env:
4042

4143
jobs:
4244
figureOutMatrix:
43-
if: ${{ github.repository == 'github/docs-internal' }}
45+
# Skip immediately if triggered by a non-successful Purge Fastly run.
46+
# This prevents skipped runs from canceling valid indexing runs via concurrency.
47+
if: ${{ github.repository == 'github/docs-internal' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') }}
4448
runs-on: ubuntu-latest
4549
outputs:
4650
matrix: ${{ steps.set-matrix.outputs.result }}
@@ -55,11 +59,13 @@ jobs:
5559
const allPossible = ["en", ...allNonEnglish]
5660
5761
if (context.eventName === "workflow_run") {
62+
// Job-level `if` already ensures we only get here for successful runs,
63+
// but keep this as a safety check.
5864
if (context.payload.workflow_run.conclusion === "success") {
5965
return ["en"]
6066
}
61-
console.warn(`NOTE! It was a workflow_run but not success ('${context.payload.workflow_run.conclusion}')`)
62-
console.warn("This means we're not going to index anything in the next dependent step.")
67+
// This shouldn't happen due to job-level filter, but handle gracefully.
68+
console.warn(`Unexpected: workflow_run with conclusion '${context.payload.workflow_run.conclusion}'`)
6369
return []
6470
}
6571

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

Lines changed: 0 additions & 106 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Check External Links
2+
3+
# Runs weekly (Wednesday) at 16:20 UTC
4+
# Validates external URLs in content files
5+
6+
on:
7+
schedule:
8+
- cron: '20 16 * * 3' # Wednesday at 16:20 UTC
9+
workflow_dispatch:
10+
inputs:
11+
max_urls:
12+
description: 'Maximum number of URLs to check (leave blank for all)'
13+
type: number
14+
15+
permissions:
16+
contents: read
17+
issues: write
18+
19+
jobs:
20+
check-external-links:
21+
if: github.repository == 'github/docs-internal'
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 180 # 3 hours for external checks
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
27+
28+
- uses: ./.github/actions/node-npm-setup
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Check external links
34+
env:
35+
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
36+
CACHE_MAX_AGE_DAYS: '7'
37+
run: |
38+
if [[ -n "${{ inputs.max_urls }}" ]]; then
39+
npm run check-links-external -- --max ${{ inputs.max_urls }}
40+
else
41+
npm run check-links-external
42+
fi
43+
44+
- name: Upload report artifact
45+
if: failure()
46+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
47+
with:
48+
name: external-link-report
49+
path: artifacts/external-link-report.*
50+
retention-days: 14
51+
52+
- name: Create issue if broken links found
53+
if: failure()
54+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v5
55+
with:
56+
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
57+
repository: github/docs-content
58+
title: '🌐 Broken External Links Report'
59+
content-filepath: artifacts/external-link-report.md
60+
labels: broken link report
61+
62+
- uses: ./.github/actions/slack-alert
63+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
64+
with:
65+
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
66+
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
name: Check Internal Links
2+
3+
# Runs weekly (Tuesday) at 16:20 UTC
4+
# On schedule: checks English free-pro-team and latest enterprise-server
5+
# On workflow_dispatch: run any version/language combo
6+
7+
on:
8+
schedule:
9+
- cron: '20 16 * * 2' # Tuesday at 16:20 UTC
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Version to check (e.g., free-pro-team@latest, [email protected])'
14+
type: string
15+
required: true
16+
language:
17+
description: 'Language to check (e.g., en, es, ja)'
18+
type: string
19+
required: true
20+
default: 'en'
21+
22+
permissions:
23+
contents: read
24+
issues: write
25+
26+
jobs:
27+
# Determine which version/language combos to run
28+
setup-matrix:
29+
if: github.repository == 'github/docs-internal'
30+
runs-on: ubuntu-latest
31+
outputs:
32+
matrix: ${{ steps.set-matrix.outputs.matrix }}
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
36+
37+
- uses: ./.github/actions/node-npm-setup
38+
39+
- name: Set matrix
40+
id: set-matrix
41+
run: |
42+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
43+
# Manual run: use the provided version and language
44+
echo 'matrix={"include":[{"version":"${{ inputs.version }}","language":"${{ inputs.language }}"}]}' >> $GITHUB_OUTPUT
45+
else
46+
# Scheduled run: English free-pro-team + English latest enterprise-server
47+
LATEST_GHES=$(npx tsx -e "import { latest } from './src/versions/lib/enterprise-server-releases'; console.log(latest)")
48+
echo "matrix={\"include\":[{\"version\":\"free-pro-team@latest\",\"language\":\"en\"},{\"version\":\"enterprise-server@${LATEST_GHES}\",\"language\":\"en\"}]}" >> $GITHUB_OUTPUT
49+
fi
50+
51+
- uses: ./.github/actions/slack-alert
52+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
53+
with:
54+
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
55+
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
56+
57+
check-internal-links:
58+
if: github.repository == 'github/docs-internal'
59+
needs: setup-matrix
60+
runs-on: ubuntu-latest
61+
strategy:
62+
fail-fast: false
63+
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
64+
env:
65+
# Disable Elasticsearch for faster warmServer
66+
ELASTICSEARCH_URL: ''
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
70+
71+
- uses: ./.github/actions/node-npm-setup
72+
73+
- name: Install dependencies
74+
run: npm ci
75+
76+
# Clone translations if not English
77+
- name: Clone translations
78+
if: matrix.language != 'en'
79+
uses: ./.github/actions/clone-translations
80+
with:
81+
token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
82+
83+
- name: Check internal links
84+
env:
85+
VERSION: ${{ matrix.version }}
86+
LANGUAGE: ${{ matrix.language }}
87+
CHECK_ANCHORS: true
88+
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
89+
run: npm run check-links-internal
90+
91+
- name: Upload report artifact
92+
if: always()
93+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
94+
with:
95+
name: link-report-${{ matrix.version }}-${{ matrix.language }}
96+
path: artifacts/link-report-*.md
97+
retention-days: 5
98+
if-no-files-found: ignore
99+
100+
- uses: ./.github/actions/slack-alert
101+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
102+
with:
103+
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
104+
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
105+
106+
# Create combined report after all matrix jobs complete
107+
create-report:
108+
if: always() && github.repository == 'github/docs-internal'
109+
needs: [setup-matrix, check-internal-links]
110+
runs-on: ubuntu-latest
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
114+
115+
- name: Download all artifacts
116+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
117+
with:
118+
path: reports
119+
pattern: link-report-*
120+
merge-multiple: true
121+
122+
- name: Combine reports
123+
id: combine
124+
run: |
125+
# Check if any reports exist
126+
if ls reports/*.md 1> /dev/null 2>&1; then
127+
echo "has_reports=true" >> $GITHUB_OUTPUT
128+
129+
# Combine all markdown reports
130+
echo "# Internal Links Report" > combined-report.md
131+
echo "" >> combined-report.md
132+
echo "Generated: $(date -u +'%Y-%m-%d %H:%M UTC')" >> combined-report.md
133+
echo "[Action run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> combined-report.md
134+
echo "" >> combined-report.md
135+
136+
for report in reports/*.md; do
137+
echo "---" >> combined-report.md
138+
cat "$report" >> combined-report.md
139+
echo "" >> combined-report.md
140+
done
141+
else
142+
echo "has_reports=false" >> $GITHUB_OUTPUT
143+
echo "No broken link reports generated - all links valid!"
144+
fi
145+
146+
- name: Create issue if broken links found
147+
if: steps.combine.outputs.has_reports == 'true'
148+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v5
149+
with:
150+
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
151+
repository: github/docs-content
152+
title: '🔗 Broken Internal Links Report'
153+
content-filepath: combined-report.md
154+
labels: broken link report
155+
156+
- uses: ./.github/actions/slack-alert
157+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
158+
with:
159+
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
160+
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

0 commit comments

Comments
 (0)