Skip to content

Commit 364ac31

Browse files
authored
Merge branch 'main' into main
2 parents a6adbe4 + c0ce3ca commit 364ac31

551 files changed

Lines changed: 10870 additions & 3570 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/copilot-instructions.md

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

.github/instructions/all.instructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ applyTo: "**"
44

55
# Copilot instructions for docs.github.com
66

7-
This repository contains code to run the GitHub Docs site on docs.github.com, as well as the content that the site displays. We write the code in JavaScript and TypeScript, and we write the content primarily in Markdown.
7+
This repository powers the GitHub Docs site (docs.github.com). It contains both the Next.js application code (TypeScript) and the documentation content (Markdown).
88

99
## Creating a pull request
1010

@@ -29,6 +29,8 @@ When you create a pull request:
2929
3. Label with "llm-generated".
3030
4. If an issue exists, include "fixes owner/repo#issue" or "towards owner/repo#issue" as appropriate.
3131
5. Always create PRs in **draft mode** using `--draft` flag.
32+
6. Do not commit directly to `main`.
33+
7. Whenever you create or comment on an issue or pull request, indicate you are GitHub Copilot.
3234

3335
## Accessing docs.github.com content programmatically
3436

.github/instructions/code.instructions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ For code reviews, follow guidelines, tests, and validate instructions. For creat
1111
- If available, use ripgrep (`rg`) instead of `grep`.
1212
- When using gh cli in double-quoted strings, escape backticks to prevent bash command substitution. In single-quoted strings, backticks do not need escaping.
1313
- All scripts should be listed in `package.json` and use `tsx`.
14-
- Whenever you create or comment on an issue or pull request, indicate you are GitHub Copilot.
1514
- Be careful fetching full HTML pages off the internet. Prefer to use MCP or gh cli whenever possible for github.com. Limit the number of tokens when grabbing HTML.
1615
- Avoid pull requests with over 300 lines of code changed. When significantly larger, offer to split up into smaller pull requests if possible.
1716
- All new code should be written in TypeScript and not JavaScript.
1817
- We use absolute imports, relative to the `src` directory, using the `@` symbol. For example, `getRedirect` which lives in `src/redirects/lib/get-redirect.ts` can be imported with `import getRedirect from '@/redirects/lib/get-redirect'`. The same rule applies for TypeScript (`.ts`) imports, e.g. `import type { GeneralSearchHit } from '@/search/types'`
1918
- For updates to the content linter, read important information in `src/content-linter/README.md`.
20-
- Do not commit to `main` branch.
2119
- Do not use git force push, and avoid git rebase.
2220

2321
## Tests

.github/instructions/style-guide-summary.instructions.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ applyTo: "content/**,data/**,**/*.md"
66

77
**When to use**: Any content editing, documentation writing, or Markdown file changes. This is a condensed version of the full style guide at `/content/contributing/style-guide-and-content-model/style-guide.md`. Use these rules for routine work. Only consult the full style guide if you encounter a style question not covered here.
88

9-
For Liquid variable usage, reusables, linking conventions, bullet-list formatting, and parenthetical dashes, see `content.instructions.md` (loaded automatically alongside this file).
9+
For Liquid variable usage, reusables, linking conventions, bullet-list markers, and parenthetical dashes, see `content.instructions.md` (loaded automatically alongside this file).
1010

1111
## Core principles
1212

@@ -52,15 +52,13 @@ For Liquid variable usage, reusables, linking conventions, bullet-list formattin
5252

5353
## Links
5454

55-
* Use `[AUTOTITLE](/path/to/article)` for all internal links. Never hardcode article titles in link text.
5655
* Introduce links with "For more information, see" or "See" when context is clear.
5756
* Do not use inline links where words within a sentence are hyperlinked without additional context.
5857
* Do not include punctuation inside a hyperlink.
5958
* Do not repeat the same link more than once in the same article.
6059

6160
## Lists
6261

63-
* Use `*` (asterisks) for unordered lists, never `-` (hyphens).
6462
* Capitalize the first letter of each list item.
6563
* Use periods only if the item is a complete sentence.
6664
* Introduce lists with a descriptive sentence, not vague phrases like "the following" in isolation.
@@ -83,9 +81,8 @@ For Liquid variable usage, reusables, linking conventions, bullet-list formattin
8381
* Use full words for Apple modifier keys (`Command`, `Option`, `Control`), not symbols.
8482
* Capitalize letter keys.
8583

86-
## Product names and variables
84+
## Product names
8785

88-
* Always use Liquid variables for product names—never hardcode them. Check `data/variables/product.yml` and `data/variables/copilot.yml`.
8986
* Product names are always singular (for example, "GitHub Actions helps" not "help").
9087

9188
## Word choice

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,27 +134,28 @@ jobs:
134134
return
135135
}
136136
137-
const tableRows = redirectGroups.map(g => {
137+
const directives = redirectGroups.map(g => {
138138
const occ = g.occurrences[0]
139139
const redirectTarget = occ?.redirectTarget ?? 'unknown'
140140
const file = occ?.file ?? 'unknown'
141-
const lines = (occ?.lines ?? []).join(', ')
142-
return `| \`${g.target}\` | \`${redirectTarget}\` | \`${file}\` | ${lines} |`
141+
const lines = (occ?.lines ?? []).join(', ') || 'unknown'
142+
return `- Update \`${g.target}\` to \`${redirectTarget}\` in \`${file}\` (line(s): ${lines})`
143143
}).join('\n')
144144
145145
const artifactsUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}/artifacts`
146146
147147
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.',
148+
'Copilot, fix the redirected internal links listed below. All changes should be made within the `github/docs-internal` repository.',
149+
'',
150+
'For each directive below, open the specified file and find the old link path. Replace it with the new link path exactly as shown. Do not invent or guess link paths — only use the exact paths provided in each directive.',
151+
'',
149152
'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.',
150153
'',
151154
`These are the first ${redirectGroups.length} of ${allRedirectGroups.length} redirects found.`,
152155
'',
153-
'## Redirects to fix',
156+
'## Redirects to update',
154157
'',
155-
'| Current Link | Update To | File | Line(s) |',
156-
'|---|---|---|---|',
157-
tableRows,
158+
directives,
158159
]
159160
160161
const MAX_ISSUE_BODY_LENGTH = 65536
@@ -179,7 +180,7 @@ jobs:
179180
agent_assignment: {
180181
target_repo: 'github/docs-internal',
181182
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+
custom_instructions: 'Follow each directive in the issue exactly. Each directive specifies a file, the old link to find, and the new link to replace it with. Use only the exact paths provided — do not invent or guess any link paths. 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.',
183184
},
184185
})
185186

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

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Notify about production deployment
22

3-
# **What it does**: Posts a comment on the PR whose merge got into production.
3+
# **What it does**: Posts a comment on every PR in the deploy that got into
4+
# production. The merge queue can batch several PRs into one
5+
# deploy, so it walks back from the deployed commit to find
6+
# all of them.
47
# **Why we have it**: So that the PR author can be informed when their merged PR is in production.
58
# **Who does it impact**: Writers
69

@@ -38,38 +41,12 @@ jobs:
3841
- name: Sleep a little to give Fastly Purge a chance
3942
run: sleep 30
4043

41-
- name: Find last PR
42-
id: get-number
44+
- name: Find PRs and post production comments
4345
timeout-minutes: 5
4446
env:
4547
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
4648
run: npm run find-past-built-pr
4749

48-
- name: Find content directory changes comment
49-
if: ${{ steps.get-number.outputs.number != '' }}
50-
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
51-
id: findComment
52-
with:
53-
issue-number: ${{ steps.get-number.outputs.number }}
54-
comment-author: 'github-actions[bot]'
55-
body-includes: '<!-- GONE_TO_PRODUCTION -->'
56-
57-
- name: Update comment
58-
if: ${{ steps.get-number.outputs.number != '' }}
59-
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
60-
with:
61-
comment-id: ${{ steps.findComment.outputs.comment-id }}
62-
issue-number: ${{ steps.get-number.outputs.number }}
63-
body: |
64-
<!-- GONE_TO_PRODUCTION -->
65-
🚀 **This pull request has gone into production!**
66-
67-
The SHA of https://docs.github.com/_build matches the merge commit in this PR.
68-
69-
If you don't see updates when expected, try adding a random query string to the URL like `?bla=1234` and see if that helps.
70-
If that shows the expected content, it would indicate that the CDN is "overly caching" the page still. It will eventually update, but it can take a while.
71-
edit-mode: replace
72-
7350
- uses: ./.github/actions/slack-alert
7451
if: ${{ failure() }}
7552
with:

.github/workflows/sync-secret-scanning.yml

Lines changed: 32 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -37,61 +37,44 @@ jobs:
3737
run: |
3838
npm run sync-secret-scanning
3939
40-
- name: Create a pull request
40+
- name: Create pull request
41+
id: create-pull-request
42+
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # pin @v8.0.0
4143
env:
42-
# Needed for gh
43-
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
44-
run: |
45-
# If nothing to commit, exit now. It's fine.
46-
changes=$(git diff --name-only | wc -l)
47-
untracked=$(git status --untracked-files --short | wc -l)
48-
if [[ $changes -eq 0 ]] && [[ $untracked -eq 0 ]]; then
49-
echo "There are no changes to commit. Exiting..."
50-
exit 0
51-
fi
52-
53-
git config --global user.name "docs-bot"
54-
git config --global user.email "77750099+docs-bot@users.noreply.github.com"
55-
56-
branchname=sync-secret-scanning-`date +%Y%m%d%H%M%S`
57-
58-
remotesha=$(git ls-remote --heads origin $branchname)
59-
if [ -n "$remotesha" ]; then
60-
# output is not empty, it means the remote branch exists
61-
echo "Branch $branchname already exists in 'github/docs-internal'. Exiting..."
62-
exit 0
63-
fi
64-
65-
git checkout -b $branchname
66-
git add .
67-
git commit -m "Add updated secret scanning data"
68-
git push origin $branchname
69-
70-
echo "Creating pull request..."
71-
gh pr create \
72-
--title "Sync secret scanning data" \
73-
--body '👋 humans. This PR updates the secret scanning data with the latest changes from github/token-scanning-service.
44+
# Disable pre-commit hooks; they don't play nicely here
45+
HUSKY: '0'
46+
with:
47+
# need to use a token with repo and workflow scopes for this step
48+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
49+
commit-message: 'Add updated secret scanning data'
50+
title: Sync secret scanning data
51+
body: |
52+
👋 humans. This PR updates the secret scanning data with the latest changes from github/token-scanning-service.
7453
7554
If CI passes, this PR will be auto-merged. :green_heart:
7655
77-
If CI does not pass or other problems arise, contact #docs-engineering on Slack.' \
78-
--repo github/docs-internal \
79-
--label secret-scanning-pipeline,'skip FR board',workflow-generated \
80-
--head=$branchname
56+
If CI does not pass or other problems arise, contact #docs-engineering on Slack.
57+
58+
This automated PR was created by [this workflow](https://github.com/github/docs-internal/blob/main/.github/workflows/sync-secret-scanning.yml).
59+
branch: sync-secret-scanning-data
60+
labels: |
61+
secret-scanning-pipeline
62+
skip FR board
63+
workflow-generated
8164
82-
# can't approve your own PR, approve with Actions
83-
echo "Approving pull request..."
84-
unset GITHUB_TOKEN
85-
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
86-
gh pr review --approve
87-
echo "Approved pull request"
65+
- name: Enable GitHub auto-merge
66+
if: ${{ steps.create-pull-request.outputs.pull-request-number }}
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
69+
AUTOMERGE_PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
70+
run: npm run enable-automerge
8871

89-
# Actions can't merge the PR so back to docs-bot to merge
90-
echo "Setting pull request to auto merge..."
91-
unset GITHUB_TOKEN
92-
gh auth login --with-token <<< "${{ secrets.DOCS_BOT_PAT_BASE }}"
93-
gh pr merge --auto --merge
94-
echo "Set pull request to auto merge"
72+
- if: ${{ steps.create-pull-request.outputs.pull-request-number }}
73+
name: Approve
74+
uses: juliangruber/approve-pull-request-action@dcc4effb325c0b503408619918d56e40653dcc91
75+
with:
76+
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
number: ${{ steps.create-pull-request.outputs.pull-request-number }}
9578

9679
- uses: ./.github/actions/slack-alert
9780
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
-4 Bytes
Loading
-5 Bytes
Loading
53.1 KB
Loading

0 commit comments

Comments
 (0)