Skip to content

Commit 2b69398

Browse files
authored
Merge branch 'main' into main
2 parents 54379ba + 00f535f commit 2b69398

629 files changed

Lines changed: 17131 additions & 9244 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/CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ This site can be developed on Windows, however a few potential gotchas need to b
116116

117117
1. Regular Expressions: Windows uses `\r\n` for line endings, while Unix-based systems use `\n`. Therefore, when working on Regular Expressions, use `\r?\n` instead of `\n` in order to support both environments. The Node.js [`os.EOL`](https://nodejs.org/api/os.html#os_os_eol) property can be used to get an OS-specific end-of-line marker.
118118
2. Paths: Windows systems use `\` for the path separator, which would be returned by `path.join` and others. You could use `path.posix`, `path.posix.join` etc and the [slash](https://ghub.io/slash) module, if you need forward slashes - like for constructing URLs - or ensure your code works with either.
119-
3. Bash: Not every Windows developer has a terminal that fully supports Bash, so it's generally preferred to write [scripts](/script) in JavaScript instead of Bash.
119+
3. Bash: Not every Windows developer has a terminal that fully supports Bash, so it's generally preferred to write new scripts in TypeScript rather than Bash.
120120
4. Filename too long error: There is a 260 character limit for a filename when Git is compiled with `msys`. While the suggestions below are not guaranteed to work and could cause other issues, a few workarounds include:
121121
- Update Git configuration: `git config --system core.longpaths true`
122122
- Consider using a different Git client on Windows

‎.github/agents/dependabot-ecosystem-update.md‎

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

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,15 @@ jobs:
420420
uses: actions/ai-inference@2c43c91ae16266ca159d311430343c67a5ffa222 # v3
421421
with:
422422
provider: copilot
423-
# No model is pinned: actions/ai-inference forwards --model to the
424-
# Copilot CLI only when it differs from its GitHub Models default, so
425-
# omitting it lets the CLI pick its own current default (latest Sonnet)
426-
# and avoids breaking when a pinned slug (e.g. gpt-4.1) is retired.
423+
# Must be an explicit empty string, not omitted. This action defaults
424+
# `model` to "gpt-4.1" and always forwards it as --model, and that slug
425+
# is retired, so omitting the input fails with:
426+
# Error: Model "gpt-4.1" from --model flag is not available.
427+
# An empty string makes the action skip --model entirely and lets the
428+
# Copilot CLI pick its own current default. See actions/ai-inference#271.
429+
model: ''
427430
prompt-file: prompt.txt
428431
system-prompt-file: system-prompt.txt
429-
max-completion-tokens: 1000
430-
temperature: 0.3
431432
env:
432433
COPILOT_GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_COPILOT }}
433434

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

Lines changed: 0 additions & 68 deletions
This file was deleted.

‎.github/workflows/check-for-spammy-issues.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
2929
const titleWordCount = issue.title.trim().split(' ').length
3030
const titleWordCountMin = 3
31+
const urlRegex = /https?:\/\/\S+/i
32+
const titleHasUrl = urlRegex.test(issue.title)
33+
const titleHasDollarSign = issue.title.includes('$')
3134
3235
try {
3336
await github.rest.teams.getMembershipForUserInOrg({
@@ -43,7 +46,7 @@ jobs:
4346
// An error will be thrown if the user is not a GitHub employee
4447
// If a user is not a GitHub employee, we should check to see if title has at least the minimum required number of words in it and if it does, we can exit the workflow
4548
46-
if (titleWordCount >= titleWordCountMin) {
49+
if (titleWordCount >= titleWordCountMin && !titleHasUrl && !titleHasDollarSign) {
4750
return
4851
}
4952
}

‎.github/workflows/check-for-spammy-prs.yml‎

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,57 @@ jobs:
2828
const repo = 'docs'
2929
const pull_number = context.payload.pull_request.number
3030
31-
const { data: files } = await github.rest.pulls.listFiles({
32-
owner: owner,
33-
repo: repo,
34-
pull_number: pull_number,
35-
});
31+
const files = await github.paginate(github.rest.pulls.listFiles, {
32+
owner,
33+
repo,
34+
pull_number,
35+
per_page: 100,
36+
})
3637
3738
const onlyDeletes = files.length > 0 && files.every(f => f.status === 'removed')
38-
const isEmptyCommit = !files.length
39+
const onlyDeletesLines =
40+
files.some(file => file.deletions > 0) &&
41+
files.every(file => file.additions === 0)
42+
const isEmptyCommit = !files.length
3943
const touchesTooMany = files.length > 10
40-
const totalChanges = files.reduce((sum, f) => sum + f.additions + f.deletions, 0)
41-
const isOneLineAddition = files.every(f => f.status === 'added') && totalChanges <= 1
42-
const isBlankLineEdit = totalChanges <= 1 && files.every(f => f.status === 'modified')
44+
const isBlankLineEdit = files.length > 0 && files.every(file => {
45+
const changedLines = (file.patch || '')
46+
.split('\n')
47+
.filter(line => /^[+-]/.test(line))
48+
return changedLines.length > 0 &&
49+
changedLines.every(line => line.slice(1).trim() === '')
50+
})
51+
const onlyRenames = files.length > 0 && files.every(f => f.status === 'renamed')
4352
4453
// Close the PR and add the invalid label
45-
if (onlyDeletes || isEmptyCommit || touchesTooMany || isOneLineAddition || isBlankLineEdit) {
46-
await github.rest.issues.update({
47-
owner: owner,
48-
repo: repo,
54+
if (
55+
onlyDeletesLines ||
56+
onlyDeletes ||
57+
isEmptyCommit ||
58+
touchesTooMany ||
59+
isBlankLineEdit ||
60+
onlyRenames
61+
) {
62+
await github.rest.issues.addLabels({
63+
owner,
64+
repo,
4965
issue_number: pull_number,
5066
labels: ['invalid'],
51-
});
67+
})
5268
5369
// Comment on the PR
5470
await github.rest.issues.createComment({
55-
owner: owner,
56-
repo: repo,
71+
owner,
72+
repo,
5773
issue_number: pull_number,
58-
body: `This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our [contribution guidelines](https://docs.github.com/en/contributing), or raise an issue.`,
59-
});
74+
body: onlyDeletesLines
75+
? `This pull request only removes existing content. Before submitting a content-removal pull request, please [open an issue](https://github.com/github/docs/issues/new/choose) explaining the proposed removal and wait for approval from the GitHub Docs team. Once the change has been approved, you can open a new pull request and link it to the issue.`
76+
: `This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our [contribution guidelines](https://docs.github.com/en/contributing), or raise an issue.`,
77+
})
78+
79+
if (onlyDeletesLines) {
80+
core.setFailed(
81+
'This pull request only deletes lines. An approved issue is required first.',
82+
)
83+
}
6084
}

‎.github/workflows/move-existing-issues-to-the-correct-repo.yml‎

Lines changed: 0 additions & 80 deletions
This file was deleted.

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,22 @@ jobs:
5454
# These are usually cross-platform `npm install` churn from contributors
5555
# editing content. We comment with reset instructions instead of pulling in
5656
# docs-engineering for review.
57+
#
58+
# Dependabot is exempt. Its security updates for transitive dependencies
59+
# change only the lockfile, because the dependency is not in package.json.
60+
# Those PRs are intentional, so the reset instructions are wrong and
61+
# suppressing the review request leaves them with no reviewer at all.
5762
- name: Detect lockfile-only churn
5863
id: detect
5964
env:
6065
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
66+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
6167
run: |
68+
if [ "$PR_AUTHOR" = "dependabot[bot]" ]; then
69+
echo "Author is Dependabot; skipping lockfile churn detection."
70+
echo "lockfile_only=false" >> "$GITHUB_OUTPUT"
71+
exit 0
72+
fi
6273
changed=$(gh pr diff "$PR" --name-only)
6374
echo "Changed files:"
6475
echo "$changed"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Add new issues and PRs to central triage board
2+
3+
# **What it does**: Adds newly opened or reopened issues and pull requests in github/docs to the right place for triage, and stamps the item with today's date.
4+
# **Why we have it**: To ensure incoming work in the public docs repo is triaged properly.
5+
# **Who does it impact**: Writers, FRs.
6+
7+
on:
8+
issues:
9+
types: [opened, reopened]
10+
pull_request_target:
11+
types: [opened, reopened, ready_for_review]
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
add-to-central-triage:
18+
runs-on: ubuntu-latest
19+
if: github.repository == 'github/docs'
20+
steps:
21+
- name: Triage to central triage board
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
24+
ITEM_URL: ${{ github.event.issue.html_url || github.event.pull_request.html_url }}
25+
# Add to the Central Triage Group project board and set date to now
26+
PROJECT_NUMBER: '19598'
27+
PROJECT_ID: 'PVT_kwDNJr_OAJ4AfQ'
28+
DATE_FIELD_ID: 'PVTF_lADNJr_OAJ4Afc4IAbbv'
29+
run: |
30+
echo "Adding $ITEM_URL to project $PROJECT_NUMBER..."
31+
ITEM_ID=$(gh project item-add "$PROJECT_NUMBER" --owner github --url "$ITEM_URL" --format json --jq '.id' || true)
32+
33+
sleep 10
34+
35+
if [ -n "$ITEM_ID" ] && [ "$ITEM_ID" != "null" ]; then
36+
echo "Editing date on item $ITEM_ID..."
37+
DATE=$(date '+%Y-%m-%d')
38+
if gh project item-edit --project-id "$PROJECT_ID" --id "$ITEM_ID" --field-id "$DATE_FIELD_ID" --date "$DATE"; then
39+
echo "done editing"
40+
else
41+
echo "::warning::gh project item-edit failed for $ITEM_URL (item $ITEM_ID); the item is on the board but the date field was not set"
42+
fi
43+
else
44+
echo "::warning::gh project item-add did not return an item id for $ITEM_URL; skipping item-edit"
45+
fi

‎.github/workflows/sync-graphql.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
with:
9696
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
9797
message: |
98-
⚠️ GraphQL Sync found ${{ needs.update_graphql_files.outputs.ignored-count }} ignored change types: ${{ needs.update_graphql_files.outputs.ignored-types }}
98+
:graphql: GraphQL Sync found ${{ needs.update_graphql_files.outputs.ignored-count }} ignored change types: ${{ needs.update_graphql_files.outputs.ignored-types }}
9999
100100
These change types are not in CHANGES_TO_REPORT and were silently ignored. Consider reviewing if they should be added to the changelog.
101101

0 commit comments

Comments
 (0)