Skip to content

Commit 790ea79

Browse files
authored
Merge branch 'main' into webhooks-testing-alternatives
2 parents 021cf0d + 6ab6574 commit 790ea79

776 files changed

Lines changed: 36319 additions & 1198948 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.

‎.devcontainer/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Update ARG and FROM together from the Node devcontainer image tags:
22
# https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
3-
ARG VARIANT=dev-24-bookworm
4-
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bookworm@sha256:42a1a7629b5a2c22c759a1de4fbb277c9e600b6fecd66b89583fc36e9453e698
3+
ARG VARIANT=dev-26-bookworm
4+
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-26-bookworm@sha256:50273c54d771adc1599a5c08ba849b4f65de1df8d8040fee3a11e8640c500d31

‎.devcontainer/devcontainer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"name": "docs.github.com",
66
"build": {
77
"dockerfile": "Dockerfile",
8-
// Update 'VARIANT' to pick a Node version
9-
"args": { "VARIANT": "24" }
8+
// The pinned FROM image in .devcontainer/Dockerfile picks the Node version. Keep VARIANT in sync.
9+
"args": { "VARIANT": "26" }
1010
},
1111

1212
// Install features. Type 'feature' in the VS Code command palette for a full list.

‎.github/actions/node-npm-setup/action.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ runs:
2020
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
2121
with:
2222
node-version-file: 'package.json'
23+
# Resolve from the Node manifest so CI uses the newest allowed version, not an older cached match.
24+
check-latest: true
2325
package-manager-cache: false
2426
cache: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' && 'npm' || '' }}
2527

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Awaiting Review reminder label message
2+
3+
# docs-internal mirrors workflows to github/docs, so send this reminder only in the public repo.
4+
on:
5+
issues:
6+
types: [labeled]
7+
8+
jobs:
9+
comment-on-issue:
10+
if: github.repository == 'github/docs' && github.event.label.name == 'awaiting-review-reminder'
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
steps:
15+
- name: Comment with contribution guidance
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
ISSUE_URL: ${{ github.event.issue.html_url }}
19+
run: |
20+
gh issue comment "$ISSUE_URL" --body-file - <<'EOF'
21+
Please do not open pull requests to address issues opened by other contributors until the issue has been marked with the `help wanted` label. The Docs team needs time to assess the issue and determine the scope of the work.
22+
23+
For more information, see [Working on other contributors' issues](https://docs.github.com/en/contributing/collaborating-on-github-docs/about-contributing-to-github-docs#working-on-other-contributors-issues).
24+
EOF

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,22 @@ jobs:
393393
fs.writeFileSync('prompt.txt', userPrompt);
394394
core.setOutput('date_str', dateStr);
395395
396+
# Use a subdirectory: checkout would clear the workspace and the prompt files above.
397+
- name: Check out package.json for the Node version
398+
if: steps.check_parent.outputs.has_parent == 'true' && steps.check_existing.outputs.exists == 'false'
399+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
400+
with:
401+
path: node-version-source
402+
sparse-checkout: /package.json
403+
sparse-checkout-cone-mode: false
404+
persist-credentials: false
405+
396406
- name: Set up Node.js for Copilot CLI
397407
if: steps.check_parent.outputs.has_parent == 'true' && steps.check_existing.outputs.exists == 'false'
398408
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
399409
with:
400-
node-version: 24
410+
node-version-file: node-version-source/package.json
411+
check-latest: true
401412

402413
- name: Install GitHub Copilot CLI
403414
if: steps.check_parent.outputs.has_parent == 'true' && steps.check_existing.outputs.exists == 'false'
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Route docs feedback internally
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
# Use the trusted base workflow for fork PRs without checking out contributor code.
7+
pull_request_target:
8+
types: [labeled]
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: docs-feedback-internal-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }}-${{ github.event.label.name }}
15+
cancel-in-progress: false
16+
17+
jobs:
18+
route-feedback:
19+
if: github.repository == 'github/docs' && github.event.label.name == 'docs-feedback-internal'
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
issues: write
24+
pull-requests: write
25+
26+
steps:
27+
- name: Record feedback in the private tracker
28+
id: record
29+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
30+
with:
31+
# GITHUB_TOKEN cannot write to another repository.
32+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
33+
script: |
34+
const sourceParams = { ...context.repo, issue_number: context.issue.number }
35+
const { data: source } = await github.rest.issues.get(sourceParams)
36+
if (!source.labels.some(label => label.name === 'docs-feedback-internal')) {
37+
core.info('The routing label was removed, so no feedback will be recorded.')
38+
return
39+
}
40+
41+
const target = { owner: 'github', repo: 'technical-content', issue_number: 8227 }
42+
const { data: tracker } = await github.rest.issues.get(target)
43+
if (tracker.state !== 'open' || tracker.pull_request) {
44+
throw new Error('The feedback tracker must be an open issue. The source will not be closed.')
45+
}
46+
47+
const marker = `<!-- docs-feedback-internal:${context.repo.owner}/${context.repo.repo}#${source.number} -->`
48+
let recorded = false
49+
for await (const { data: comments } of github.paginate.iterator(
50+
github.rest.issues.listComments,
51+
{ ...target, per_page: 100 },
52+
)) {
53+
if (comments.some(comment => comment.body?.startsWith(`${marker}\n`))) {
54+
recorded = true
55+
break
56+
}
57+
}
58+
59+
if (!recorded) {
60+
const description = source.body || '_No description provided._'
61+
// Leave room for metadata within GitHub's comment size limit.
62+
const excerpt = description.length > 60000
63+
? `${description.slice(0, 60000)}\n\n_Description truncated. See the source for the full text._`
64+
: description
65+
const kind = context.payload.pull_request ? 'Pull request' : 'Issue'
66+
await github.rest.issues.createComment({
67+
...target,
68+
body: [
69+
marker,
70+
`## ${source.title}`,
71+
'',
72+
`${kind}: ${source.html_url}`,
73+
`Author: @${source.user.login}`,
74+
`Routed by: @${context.actor}`,
75+
'',
76+
excerpt,
77+
].join('\n'),
78+
})
79+
}
80+
81+
core.setOutput('recorded', 'true')
82+
83+
- name: Explain the handoff and close the source
84+
if: steps.record.outputs.recorded == 'true'
85+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
86+
with:
87+
script: |
88+
const sourceParams = { ...context.repo, issue_number: context.issue.number }
89+
const { data: source } = await github.rest.issues.get(sourceParams)
90+
if (!source.labels.some(label => label.name === 'docs-feedback-internal')) {
91+
core.info('The routing label was removed, so the source will not be closed.')
92+
return
93+
}
94+
95+
// Do not expose the private tracker URL in this public comment.
96+
const marker = '<!-- docs-feedback-internal:handoff -->'
97+
let explained = false
98+
for await (const { data: comments } of github.paginate.iterator(
99+
github.rest.issues.listComments,
100+
{ ...sourceParams, per_page: 100 },
101+
)) {
102+
if (comments.some(comment =>
103+
comment.user?.login === 'github-actions[bot]' &&
104+
comment.body?.startsWith(`${marker}\n`)
105+
)) {
106+
explained = true
107+
break
108+
}
109+
}
110+
111+
if (!explained) {
112+
await github.rest.issues.createComment({
113+
...sourceParams,
114+
body: `${marker}\nThank you for the feedback! We've recorded it for internal review by the documentation team, so we're closing this here. This does not mean the underlying feedback has been resolved.`,
115+
})
116+
}
117+
118+
if (source.state === 'open') {
119+
if (context.payload.pull_request) {
120+
await github.rest.pulls.update({
121+
...context.repo,
122+
pull_number: source.number,
123+
state: 'closed',
124+
})
125+
} else {
126+
await github.rest.issues.update({
127+
...sourceParams,
128+
state: 'closed',
129+
state_reason: 'not_planned',
130+
})
131+
}
132+
}

0 commit comments

Comments
 (0)