Skip to content

Commit e151d64

Browse files
author
cometacosin
authored
Merge branch 'github:main' into main
2 parents 2daf16c + ffe6bb5 commit e151d64

File tree

1,406 files changed

+2371709
-269803
lines changed

Some content is hidden

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

1,406 files changed

+2371709
-269803
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@
5959
},
6060

6161
// Lifecycle commands
62-
"onCreateCommand": "npm ci",
62+
// Install dependencies then install Copilot CLI
63+
"onCreateCommand": "npm ci && npm install -g @github/copilot@prerelease",
64+
// Start a web server and keep it running
6365
"postStartCommand": "nohup bash -c 'npm start &'",
64-
// Set the port to be public
66+
// Set port 4000 to be public
6567
"postAttachCommand": "gh cs ports visibility 4000:public -c \"$CODESPACE_NAME\"",
66-
68+
6769
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
6870
"remoteUser": "node",
6971

.github/CODEOWNERS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ src/ghes-releases/lib/enterprise-dates.json @github/docs-content-enterprise
1212

1313
# Requires review of #actions-oidc-integration, docs-engineering/issues/1506
1414
# content/actions/deployment/security-hardening-your-deployments/** @github/oidc
15-
16-
# RAI - CELA
17-
data/reusables/rai/** @github/legal-product

.github/CONTRIBUTING.md

Lines changed: 64 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,86 +2,113 @@
22

33
Thank you for investing your time in contributing to our project! Any contribution you make will be reflected on [docs.github.com](https://docs.github.com/en) :sparkles:.
44

5+
**📖 For comprehensive contribution guidance, please visit our official documentation at [docs.github.com/en/contributing](https://docs.github.com/en/contributing). This is our canonical source for all contribution processes and policies.**
6+
57
Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable.
68

7-
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
9+
This guide provides repository-specific information to supplement the official contribution documentation. For detailed processes, policies, and best practices, always refer to [docs.github.com/en/contributing](https://docs.github.com/en/contributing).
810

9-
Use the table of contents icon <img alt="Table of contents icon" src="/contributing/images/table-of-contents.png" width="25" height="25" /> on the top left corner of this document to get to a specific section of this guide quickly.
11+
Use the table of contents icon <img alt="Table of contents icon" src="/contributing/images/table-of-contents.png" width="25" height="25" /> in the top corner of this document to get to a specific section of this guide quickly.
1012

1113
## New contributor guide
1214

13-
To get an overview of the project, read the [README](../README.md) file. Here are some resources to help you get started with open source contributions:
15+
**Start here:** Visit [docs.github.com/en/contributing](https://docs.github.com/en/contributing) for complete contributor onboarding and guidelines.
16+
17+
For repository-specific setup, read the [README](../README.md) file. The official docs site also provides these helpful resources:
1418

1519
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
1620
- [Set up Git](https://docs.github.com/en/get-started/git-basics/set-up-git)
1721
- [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow)
1822
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
1923

24+
## Contribution types and what we're looking for
2025

21-
## Getting started
26+
Content we accept:
27+
* Technical and grammatical corrections
28+
* Typo fixes
29+
* Expanded explanations of existing products or features, when the expansion has a compelling reason
30+
* New content filling important gaps in our documentation. For example, [this pull request](https://github.com/github/docs/pull/38048) added a useful section on security hardening for GitHub Actions.
2231

23-
To navigate our codebase with confidence, see [the introduction to working in the docs repository](/contributing/README.md) :confetti_ball:. For more information on how we write our markdown files, see "[Using Markdown and Liquid in GitHub Docs](https://docs.github.com/en/contributing/writing-for-github-docs/using-markdown-and-liquid-in-github-docs)."
32+
Content we do not currently accept:
33+
* Edits purely for tone, readability, or efficiency
34+
* Topics that are too niche or a matter of personal preference
35+
* Changes to the underlying site and workflows
2436

25-
Check to see what [types of contributions](/contributing/types-of-contributions.md) we accept before making changes. Some of them don't even require writing a single line of code :sparkles:.
37+
These are general guidelines, but if you’re not sure what category your proposed change would fall under, feel free to open an issue to discuss it with us!
2638

27-
### Issues
39+
## Getting started
2840

29-
#### Create a new issue
41+
📚 **Primary resource:** [docs.github.com/en/contributing](https://docs.github.com/en/contributing) contains our complete contribution workflow and policies.
3042

31-
If you spot a problem with the docs, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/github/docs/issues/new/choose).
43+
For repository-specific information:
44+
- See [the introduction to working in the docs repository](/contributing/README.md) :confetti_ball:
45+
- Check our [types of contributions](/contributing/types-of-contributions.md) we accept
46+
- Review our markdown style guidelines in the `/contributing` directory
3247

33-
#### Solve an issue
48+
### Writing style guidelines
3449

35-
Scan through our [existing issues](https://github.com/github/docs/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See "[Label reference](https://docs.github.com/en/contributing/collaborating-on-github-docs/label-reference)" for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix.
50+
When contributing content, please follow these key principles from our [style guide](https://docs.github.com/en/contributing/style-guide-and-content-model/style-guide):
3651

37-
### Make Changes
52+
- **Clarity and simplicity**: The goal of our writing style is clarity and simplicity.
53+
- **Meaning over grammar**: Grammatical correctness is important, but not as important as clarity and meaning.
54+
- **Second person**: The docs use second-person ("you") to communicate directly with readers.
55+
- **Inclusive language**: Use inclusive language by not assuming gender or ability level, and by avoiding slang and idioms.
56+
- **Accessible technical language**: Jargon is sometimes necessary, but don't assume every reader has your technical expertise.
57+
- **Active voice**: Use active voice wherever possible. Active voice means avoiding "be" verbs like "is" or "are" when you can, but also choosing more dynamic verbs to get your point across. "Press (a key)" is less dynamic than "tap (a key)," for example.
58+
- **Clear terminology**: Avoid technical abbreviations like "repo" and "PR," and Latin abbreviations like "i.e." and "e.g."
3859

39-
#### Make changes in the UI
60+
For complete style guidance, see our [style guide](https://docs.github.com/en/contributing/style-guide-and-content-model/style-guide).
4061

41-
Click **Make a contribution** at the bottom of any docs page to make small changes such as a typo, sentence fix, or a broken link. This takes you to the `.md` file where you can make your changes and [create a pull request](#pull-request) for a review.
62+
### Issues
63+
64+
**For detailed issue guidelines, see [docs.github.com/en/contributing](https://docs.github.com/en/contributing).**
4265

43-
<img src="/contributing/images/contribution_cta.png" />
66+
#### Repository-specific notes:
67+
- Search [existing issues](https://github.com/github/docs/issues) before creating new ones
68+
- Use our [label reference](https://docs.github.com/en/contributing/collaborating-on-github-docs/label-reference) to categorize appropriately
69+
- Follow the issue templates provided in this repository
4470

45-
#### Make changes in a codespace
71+
### Make Changes
4672

47-
For more information about using a codespace for working on GitHub documentation, see "[Working in a codespace](https://github.com/github/docs/blob/main/contributing/codespace.md)."
73+
**Complete change guidelines are available at [docs.github.com/en/contributing](https://docs.github.com/en/contributing).**
4874

49-
#### Make changes locally
75+
#### Repository-specific options:
5076

51-
1. Fork the repository.
52-
- Using GitHub Desktop:
53-
- [Getting started with GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop) will guide you through setting up Desktop.
54-
- Once Desktop is set up, you can use it to [fork the repo](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)!
77+
**Make changes in the UI:** Click **Make a contribution** at the bottom of any docs page for small changes like typos or broken links.
5578

56-
- Using the command line:
57-
- [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them.
79+
<img src="/contributing/images/contribution_cta.png" />
5880

59-
2. Install or update to **Node.js**, at the version specified in `.node-version`. For more information, see [the development guide](../contributing/development.md).
81+
**Make changes in a codespace:** See "[Working in a codespace](https://github.com/github/docs/blob/main/contributing/codespace.md)" for documentation-specific setup.
6082

61-
3. Create a working branch and start with your changes!
83+
**Make changes locally:**
84+
1. Fork the repository (see [official forking guide](https://docs.github.com/en/contributing))
85+
2. Install Node.js at the version specified in `.node-version` (see [development guide](../contributing/development.md))
86+
3. Create a working branch and start with your changes
6287

6388
### Commit your update
6489

65-
Commit the changes once you are happy with them. Don't forget to use the "[Self review checklist](https://docs.github.com/en/contributing/collaborating-on-github-docs/self-review-checklist)" to speed up the review process :zap:.
90+
Follow the guidelines at [docs.github.com/en/contributing](https://docs.github.com/en/contributing) for commit best practices.
91+
92+
Use our "[Self review checklist](https://docs.github.com/en/contributing/collaborating-on-github-docs/self-review-checklist)" before committing.
6693

6794
### Pull Request
6895

69-
When you're finished with the changes, create a pull request, also known as a PR.
70-
- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request.
71-
- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
72-
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.
73-
Once you submit your PR, a Docs team member will review your proposal. We may ask questions or request additional information.
74-
- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
75-
- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations).
76-
- If you run into any merge issues, checkout this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.
96+
**Complete pull request (PR) guidelines:** [docs.github.com/en/contributing](https://docs.github.com/en/contributing)
97+
98+
**Repository-specific notes:**
99+
- Fill the "Ready for review" template
100+
- [Link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if applicable
101+
- Enable [maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)
102+
103+
A Docs team member will review following our [standard review process](https://docs.github.com/en/contributing).
77104

78105
### Your PR is merged!
79106

80107
Congratulations :tada::tada: The GitHub team thanks you :sparkles:.
81108

82-
Once your PR is merged, your contributions will be publicly visible on the [GitHub docs](https://docs.github.com/en).
109+
Once merged, your contributions will be visible on [GitHub docs](https://docs.github.com/en).
83110

84-
Now that you are part of the GitHub docs community, see how else you can [contribute to the docs](/contributing/types-of-contributions.md).
111+
Continue contributing using our [types of contributions guide](/contributing/types-of-contributions.md) or explore more opportunities at [docs.github.com/en/contributing](https://docs.github.com/en/contributing).
85112

86113
## Windows
87114

.github/actions/get-changed-files/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ runs:
3333
- name: Gather changed files
3434
id: get_changes
3535
env:
36+
INPUT_FILES: ${{ inputs.files }}
3637
INPUT_HEAD: ${{ inputs.head || github.event.pull_request.head.ref || github.event.merge_group.head_ref || github.ref_name }}
3738
INPUT_OUTPUT_FILE: ${{ inputs.output_file }}
3839
shell: bash

.github/actions/get-changed-files/get-changed-files.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ git fetch --depth=1 origin main
1818
git fetch --depth=1 origin ${INPUT_HEAD:-HEAD}
1919

2020
# Get diff with status information
21-
# Find the merge-base (common ancestor) instead of using origin/main directly
2221
echo "__ running git diff with status __"
23-
DIFF_OUTPUT=$(git diff --name-status origin/main...origin/${INPUT_HEAD:-HEAD})
22+
DIFF_OUTPUT=$(git diff --name-status origin/main origin/${INPUT_HEAD:-HEAD})
2423

2524
# Function to extract files by pattern from diff output
2625
extract_files() {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
# Copilot instructions for docs.github.com
6+
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.
8+
9+
## Creating a pull request
10+
11+
When you create a pull request:
12+
13+
1. **Always** make the first line of the PR description the following (in italics):
14+
15+
`_Copilot Chat generated this pull request._`
16+
17+
2. Optionally, you may include a collapsed section summarizing the prompt or discussion with Copilot Chat:
18+
19+
```markdown
20+
<details><summary>Prompt summary - submitted by @GITHUB-USER-ID</summary>
21+
22+
> [Prompt summary text here]
23+
24+
</details>
25+
```
26+
27+
This helps reviewers understand the context and intent behind the automated changes.
28+
29+
3. Label with "llm-generated".
30+
4. If an issue exists, include "fixes owner/repo#issue" or "towards owner/repo#issue" as appropriate.
31+
5. Always _escape backticks_ when you use gh cli.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
applyTo: "src/**,.github/**,config/**,.devcontainer/**,**Dockerfile,package*.json"
3+
---
4+
5+
# Copilot code instructions for docs.github.com
6+
7+
For code reviews, follow guidelines, tests, and validate instructions. For creating or updating pull requests or branches, follow the steps instructions.
8+
9+
## Guidelines
10+
11+
- If available, use ripgrep (`rg`) instead of `grep`.
12+
- Make sure to always _escape backticks_ when using gh cli.
13+
- 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 an LLM.
15+
- Be careful fetching full HTML pages off the internet. Prefer to use gh cli whenever possible for github.com. Limit the number of tokens when grabbing HTML.
16+
- Avoid pull requests with over 300 lines of code changed. When significantly larger, offer to split up into smaller pull requests if possible.
17+
- All new code should be written in TypeScript and not JavaScript.
18+
- 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'`
19+
20+
## Tests
21+
22+
We use `vitest` to write unit tests. Tests live in their own files in the `tests` subdirectory of a source (src) directory, e.g. `src/search/tests/api-ai-search.ts`. For integration tests, we can use the mock server in `src/tests/mocks/start-mock-server.ts` to mock external requests. For UI rendering tests, we use `playwright` and write tests in `src/fixtures/tests/playwright-rendering.spec.ts`
23+
24+
- `npm run test`: For all unit tests
25+
- You can pass specific paths, e.g. `npm run test -- src/search/tests/ai-search-proxy`
26+
- You can add `--silent=false` to include `console.log` debugging.
27+
- `npm run build && npm run playwright-test -- playwright-rendering`: You need to build for changes outside of the test to be picked up. We use playwright for all rendering and end-to-end tests
28+
- You can add `--ui` to keep open `localhost:4000` which can be viewed in a simple browser for debugging UI state.
29+
- `npm run dev` to start the development server on `localhost:4000`.
30+
- `ROOT=src/fixtures/fixtures TRANSLATIONS_FIXTURE_ROOT=src/fixtures/fixtures/translations vitest src/fixtures/tests` for tests that involve fixtures.
31+
32+
## Validate
33+
34+
Run the following commands to validate your changes:
35+
36+
- `npm run tsc`
37+
- `npm run build`
38+
- `npm run prettier`
39+
- `npm run lint`: you can include `-- --fix`
40+
41+
## Steps
42+
43+
0. Ask the human if they would like you to follow these steps.
44+
1. If this is new work, make sure you have the latest changes by running `git checkout main && git pull`. If this is existing work, update the branch you are working on with the head branch -- usually `main`.
45+
2. If the human provides a GitHub issue, use gh cli to read the issue and all comments.
46+
3. Begin by evaluating impact, effort, and estimate non-test lines of code that will change. Ask for more context and examples if needed.
47+
4. If you are running in agentic mode, _stop_ at this point and request approval from the human.
48+
5. If you need to add or change tests, work on tests before implementing.
49+
6. Implement the changes needed. If you are running in agentic mode, _stop_ and ask questions at decision points. Please list the options, pros and cons for each decision needed.
50+
7. Validate your changes before making any commits. See "Validate".
51+
8. Validate that any new or changed tests pass. See "Tests".
52+
9. Validate that these changes meet our guidelines. See "Guidelines".
53+
10. If you are running in agentic mode, _stop_ at this point and request review before continuing. Suggest how the human should review the changes.
54+
11. If a branch and pull request already exist, commit and push, then _concisely_ comment on the pull request that you are an LLM and what changes you made and why.
55+
12. If this is new work and no pull request exists yet, make a pull request:
56+
- label "llm-generated"
57+
- draft mode
58+
- include "fixes owner/repo#issue" or "towards owner/repo#issue" as appropriate
59+
13. If you are in agentic mode, offer to wait for CI to run and check that it passes. If the human agrees, verify in CI: `sleep 240 && gh pr checks $number`. Address all failures, don't assume they're flakes.
60+
14. If you are in agentic mode, offer to do any or all of:
61+
- mark the pull request as ready,
62+
- assign the issue to the human if it is not already assigned,
63+
- _concisely_ comment on the issue explaining the change, indicating you are an LLM.

0 commit comments

Comments
 (0)