Skip to content

Commit 93dbfa1

Browse files
Merge branch 'main' into docs/private-action-example-clarify
2 parents e64db71 + be1dea4 commit 93dbfa1

1,170 files changed

Lines changed: 543798 additions & 499463 deletions

File tree

Some content is hidden

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

.github/aw/actions-lock.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"entries": {
3+
"actions/github-script@v8": {
4+
"repo": "actions/github-script",
5+
"version": "v8",
6+
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
7+
},
8+
"actions/github-script@v9.0.0": {
9+
"repo": "actions/github-script",
10+
"version": "v9.0.0",
11+
"sha": "3a2844b7e9c422d3c10d287c895573f7108da1b3"
12+
},
13+
"github/gh-aw-actions/setup@v0.71.5": {
14+
"repo": "github/gh-aw-actions/setup",
15+
"version": "v0.71.5",
16+
"sha": "b8068426813005612b960b5ab0b8bd2c27142323"
17+
}
18+
}
19+
}

.github/workflows/changelog-agent.lock.yml

Lines changed: 1956 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/changelog-agent.md

Lines changed: 459 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/headless-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
node:
3434
- playwright-rendering
3535
- playwright-a11y
36+
- playwright-secret-scanning
3637
fail-fast: false
3738
timeout-minutes: 60
3839
steps:
@@ -59,6 +60,7 @@ jobs:
5960
PLAYWRIGHT_WORKERS: ${{ fromJSON('[1, 4]')[github.repository == 'github/docs-internal'] }}
6061
# workaround for https://github.com/nodejs/node/issues/59364 as of 22.18.0
6162
NODE_OPTIONS: '--no-experimental-strip-types'
63+
PLAYWRIGHT_TIMEOUT: ${{ matrix.node == 'playwright-a11y' && '60000' || '' }}
6264

6365
# Run playwright rendering tests and a11y tests (axe scans) as distinct checks
6466
# so that we can run them without blocking merges until we can be confident

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,36 @@ jobs:
331331
**Workflow file:** $FILE_URL
332332
333333
This issue was automatically created by the \`$WORKFLOW_NAME\` workflow.
334+
335+
---
336+
337+
## Instructions for the issue analysis agent
338+
339+
These scraping failures are **almost never timeouts**. They are
340+
almost always caused by Liquid/Markdown corruptions in the
341+
translated source that make the page fail to render. Please do not
342+
file this as a transient/timeout issue.
343+
344+
To investigate:
345+
346+
1. Pull the translation repos locally:
347+
\`\`\`
348+
npm run clone-translations
349+
\`\`\`
350+
2. Identify the specific corruptions with the canonical reporter
351+
(verify the exact script name in \`package.json\` before running):
352+
\`\`\`
353+
npm run count-translation-corruptions
354+
\`\`\`
355+
The script writes a structured JSON report to stdout listing each
356+
corrupted file, its location, the error message, and the
357+
offending/illegal tag token when available.
358+
3. **Open a pull request that fixes the corruptions** rather than
359+
just commenting the findings on this issue. The issue body above
360+
already lists the affected pages; the value the agent adds is
361+
the fix. Where possible, fix the underlying pattern in
362+
\`src/languages/lib/correct-translation-content.ts\` so the same
363+
corruption is corrected on future syncs.
334364
EOF
335365
)
336366
gh issue create \

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

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ on:
1414
type: string
1515
required: true
1616
default: 'en'
17+
create_copilot_issue:
18+
description: 'Create a Copilot-assigned issue with the top 10 redirects to fix'
19+
type: boolean
20+
required: false
21+
default: false
22+
create_report:
23+
description: 'Create the combined broken links report issue in docs-content'
24+
type: boolean
25+
required: false
26+
default: true
1727

1828
permissions:
1929
contents: read
@@ -101,6 +111,80 @@ jobs:
101111
retention-days: 5
102112
if-no-files-found: ignore
103113

114+
- name: Create Copilot redirect issue
115+
if: inputs.create_copilot_issue
116+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
117+
with:
118+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
119+
script: |
120+
const fs = require('fs')
121+
const reportFile = 'artifacts/link-report-${{ matrix.version }}-${{ matrix.language }}.json'
122+
123+
if (!fs.existsSync(reportFile)) {
124+
core.info('No JSON report found — all links valid, skipping Copilot issue.')
125+
return
126+
}
127+
128+
const report = JSON.parse(fs.readFileSync(reportFile, 'utf8'))
129+
const allRedirectGroups = report.groups.filter(g => g.isWarning)
130+
const redirectGroups = allRedirectGroups.slice(0, 10)
131+
132+
if (redirectGroups.length === 0) {
133+
core.info('No redirect groups found, skipping Copilot issue.')
134+
return
135+
}
136+
137+
const tableRows = redirectGroups.map(g => {
138+
const occ = g.occurrences[0]
139+
const redirectTarget = occ?.redirectTarget ?? 'unknown'
140+
const file = occ?.file ?? 'unknown'
141+
const lines = (occ?.lines ?? []).join(', ')
142+
return `| \`${g.target}\` | \`${redirectTarget}\` | \`${file}\` | ${lines} |`
143+
}).join('\n')
144+
145+
const artifactsUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/artifacts`
146+
147+
const bodyLines = [
148+
'Copilot please fix the redirected internal links listed in the table below. All changes should be made within the `github/docs-internal` repository. For each entry, open the source file and replace the **Current Link** with the **Update To** path.',
149+
'When all changes are made, open a pull request in `github/docs-internal` with the fixes. The pull request description should reference this issue to create a link between them. When the pull request is open, leave a comment on this issue with a link to it.',
150+
'',
151+
`These are the first ${redirectGroups.length} of ${allRedirectGroups.length} redirects found.`,
152+
'',
153+
'## Redirects to fix',
154+
'',
155+
'| Current Link | Update To | File | Line(s) |',
156+
'|---|---|---|---|',
157+
tableRows,
158+
]
159+
160+
const MAX_ISSUE_BODY_LENGTH = 65536
161+
const artifactNote = `\n\n> [!NOTE]\n> The report was truncated because it exceeded the issue body length limit. [View the complete redirect report in the workflow artifacts](${artifactsUrl}).`
162+
163+
let body = bodyLines.join('\n')
164+
if (body.length > MAX_ISSUE_BODY_LENGTH) {
165+
const truncatedLength = MAX_ISSUE_BODY_LENGTH - artifactNote.length
166+
const lastNewline = body.lastIndexOf('\n', truncatedLength)
167+
body = body.slice(0, lastNewline > 0 ? lastNewline : truncatedLength) + artifactNote
168+
}
169+
170+
// Use the REST API with agent_assignment to properly trigger Copilot cloud agent.
171+
// See: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/cloud-agent/start-copilot-sessions#using-the-rest-api
172+
const issue = await github.request('POST /repos/{owner}/{repo}/issues', {
173+
owner: 'github',
174+
repo: 'docs-content',
175+
title: '[Copilot Task] Fix top redirect links: ${{ matrix.version }}/${{ matrix.language }}',
176+
body,
177+
labels: ['broken link report'],
178+
assignees: ['copilot-swe-agent[bot]'],
179+
agent_assignment: {
180+
target_repo: 'github/docs-internal',
181+
base_branch: 'main',
182+
custom_instructions: 'For each entry in the table, open the source file in the github/docs-internal repository and replace the Current Link with the Update To path. When all changes are made, open a pull request in github/docs-internal with the fixes. When the pull request is open, leave a comment on this issue with a link to it.',
183+
},
184+
})
185+
186+
core.info(`Created Copilot redirect issue: ${issue.data.html_url}`)
187+
104188
- uses: ./.github/actions/slack-alert
105189
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
106190
with:
@@ -159,7 +243,7 @@ jobs:
159243
fi
160244
161245
- name: Create issue if broken links found
162-
if: steps.combine.outputs.has_reports == 'true'
246+
if: steps.combine.outputs.has_reports == 'true' && (github.event_name != 'workflow_dispatch' || inputs.create_report != false)
163247
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v5
164248
with:
165249
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ jobs:
4141
with:
4242
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
4343
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
44+
45+
- uses: ./.github/actions/create-workflow-failure-issue
46+
if: ${{ failure() }}
47+
with:
48+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

.github/workflows/no-response.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,8 @@ jobs:
6363
with:
6464
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
6565
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
66+
67+
- uses: ./.github/actions/create-workflow-failure-issue
68+
if: ${{ failure() }}
69+
with:
70+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

.github/workflows/notify-about-deployment.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,8 @@ jobs:
7575
with:
7676
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
7777
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
78+
79+
- uses: ./.github/actions/create-workflow-failure-issue
80+
if: ${{ failure() }}
81+
with:
82+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

.github/workflows/reviewers-docs-engineering.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
${{ github.repository == 'github/docs-internal' &&
4141
!github.event.pull_request.draft &&
4242
!contains(github.event.pull_request.labels.*.name, 'reviewers-docs-engineering') &&
43+
!contains(github.event.pull_request.labels.*.name, 'lockfile-churn-only') &&
4344
github.event.pull_request.head.ref != 'repo-sync' }}
4445
runs-on: ubuntu-latest
4546
env:
@@ -50,7 +51,45 @@ jobs:
5051
- name: Checkout repository
5152
uses: actions/checkout@v6.0.1
5253

54+
# Detect PRs that only changed package-lock.json (no engineering source files).
55+
# These are usually cross-platform `npm install` churn from contributors
56+
# editing content. We comment with reset instructions instead of pulling in
57+
# docs-engineering for review.
58+
- name: Detect lockfile-only churn
59+
id: detect
60+
run: |
61+
changed=$(gh pr diff "$PR" --name-only)
62+
echo "Changed files:"
63+
echo "$changed"
64+
lockfile=$(echo "$changed" | grep -c '^package-lock\.json$' || true)
65+
other_eng=$(echo "$changed" | grep -cE '(\.tsx?$|\.scss$|^src/|^package\.json$|^\.github/|^config/|^\.devcontainer/|Dockerfile)' || true)
66+
if [ "$lockfile" -gt 0 ] && [ "$other_eng" -eq 0 ]; then
67+
echo "lockfile_only=true" >> "$GITHUB_OUTPUT"
68+
else
69+
echo "lockfile_only=false" >> "$GITHUB_OUTPUT"
70+
fi
71+
72+
- name: Comment and label lockfile-only PRs
73+
if: steps.detect.outputs.lockfile_only == 'true'
74+
run: |
75+
cat > /tmp/lockfile-churn-body.md <<'EOF'
76+
_Posted by Copilot on behalf of docs-engineering._
77+
78+
This PR includes `package-lock.json` changes but no engineering files. Please reset the lockfile:
79+
80+
```
81+
git checkout origin/main -- package-lock.json
82+
git commit -m "Reset package-lock.json"
83+
git push
84+
```
85+
86+
If the lockfile change is intentional, remove the `lockfile-churn-only` label and request docs-engineering review.
87+
EOF
88+
gh pr comment "$PR" --body-file /tmp/lockfile-churn-body.md
89+
gh pr edit "$PR" --add-label lockfile-churn-only
90+
5391
- name: Add docs engineering as a reviewer
92+
if: steps.detect.outputs.lockfile_only != 'true'
5493
uses: ./.github/actions/retry-command
5594
with:
5695
command: gh pr edit $PR --add-reviewer github/docs-engineering --add-label reviewers-docs-engineering

0 commit comments

Comments
 (0)