Skip to content

Commit 5b22da2

Browse files
Merge branch 'main' into gha-hardening-pull-request-target
2 parents 2d18afb + b42ac79 commit 5b22da2

File tree

391 files changed

+1495
-1649
lines changed

Some content is hidden

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

391 files changed

+1495
-1649
lines changed

.github/copilot-instructions.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
1-
This documentation repository consists mainly of content written in Markdown format. These files are converted into HTML for displaying on a website. Most Markdown files become a single article on the documentation site. Other files contain reusable content which is inserted into multiple articles. The repository also contains YAML files (e.g. for variable text), image files, JavaScript/TypeScript files, etc.
1+
This repository contains code to run the GitHub Docs site on docs.github.com, as well as the content that is displayed on the site. The code is written in JavaScript and TypeScript, and the content is primarily written in Markdown.
2+
3+
Changes to files in `src/*` or files with `.ts` or `.js` extensions are likely code-related changes. Please follow the engineering guidelines below when making changes to these files.
4+
5+
Changes to files in `content/*` and `data/*` are likely content-related changes. Content changes include updates to articles, reusable content, and data files that define variables used in articles. Please follow the content guidelines below when making changes to these files.
6+
7+
## Engineering guidelines
8+
9+
### Scripts
10+
11+
All scripts can be found in `package.json`.
12+
13+
To validate any code changes:
14+
- `npm run tsc`
15+
- `npm run build`
16+
- `npm run prettier`
17+
- `npm run lint`: you can include `-- --fix`
18+
19+
To validate specific changes,
20+
- `npm run test`: For all unit tests
21+
- You can pass specific paths, e.g. `npm run test -- src/search/tests/ai-search-proxy`
22+
- You can add `--silent=false` to include `console.log` debugging.
23+
- `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
24+
- You can add `--ui` to keep open `localhost:4000` which can be viewed in a simple browser for debugging UI state.
25+
- `npm run dev` to start the development server on `localhost:4000`.
26+
27+
### Imports
28+
29+
We use absolute imports, relative to the `src` directory, using the `@` symbol.
30+
31+
For example, `getRedirect` which lives inn `src/redirects/lib/get-redirect.js` can be imported with `import getRedirect from '@/redirects/lib/get-redirect'`.
32+
33+
The same rule applies for TypeScript (`.ts`) imports, e.g. `import type { GeneralSearchHit } from '@/search/types'`
34+
35+
### Testing changes
36+
37+
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`.
38+
39+
For integration tests, we can use the mock server in `src/tests/mocks/start-mock-server.ts` to mock exteneral requests.
40+
41+
For UI rendering tests, we use `playwright` and write tests in `src/fixtures/tests/playwright-rendering.spec.ts`
242

343
## Content guidelines
444

@@ -90,31 +130,11 @@ Then, within a collapsed section, quote the original prompt from Copilot Chat:
90130

91131
This helps reviewers understand the context and intent behind the automated changes.
92132

93-
## Development and testing guidelines
94-
95-
### Content changes
133+
### Testing Content changes
96134

97135
Before committing content changes, always:
98136

99137
1. **Use the content linter** to validate content: `npm run lint-content -- --paths <file-paths>`
100138
2. **Check for proper variable usage** in your content
101139
3. **Verify [AUTOTITLE] links** point to existing articles
102140
4. **Run tests** on changed content: `npm run test -- src/content-render/tests/render-changed-and-deleted-files.js`
103-
104-
### Script and code changes
105-
106-
For TypeScript, JavaScript, and SCSS files:
107-
108-
1. **Run Prettier** to check formatting: `npm run prettier-check`
109-
2. **Run the linter**: `npm run lint`
110-
3. **Run TypeScript checks**: `npm run tsc`
111-
4. **Run relevant tests**: `npm test`
112-
113-
### Environment setup
114-
115-
When testing changes in your development environment:
116-
117-
1. Install dependencies: `npm ci`
118-
2. For content changes, ensure the content linter runs successfully
119-
3. For script changes, ensure all formatting and linting checks pass
120-
4. Always verify your changes don't break existing functionality

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ---------------------------------------------------------------
99
# To update the sha:
1010
# https://github.com/github/gh-base-image/pkgs/container/gh-base-image%2Fgh-base-noble
11-
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250707-185623-g8becf904e AS base
11+
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250709-201453-g6a417ef5f AS base
1212

1313
# Install curl for Node install and determining the early access branch
1414
# Install git for cloning docs-early-access & translations repos
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: About continuous integration with GitHub Actions
2+
title: Continuous integration
33
intro: 'You can create custom continuous integration (CI) workflows directly in your {% data variables.product.prodname_dotcom %} repository with {% data variables.product.prodname_actions %}.'
44
redirect_from:
55
- /articles/about-continuous-integration
@@ -10,6 +10,7 @@ redirect_from:
1010
- /actions/automating-builds-and-tests/about-continuous-integration
1111
- /actions/about-github-actions/about-continuous-integration
1212
- /actions/about-github-actions/about-continuous-integration-with-github-actions
13+
- /actions/concepts/overview/about-continuous-integration-with-github-actions
1314
versions:
1415
fpt: '*'
1516
ghes: '*'
@@ -44,13 +45,6 @@ In addition to helping you set up CI workflows for your project, you can use {%
4445

4546
For a definition of common terms, see [AUTOTITLE](/actions/learn-github-actions/understanding-github-actions).
4647

47-
## Workflow templates
48+
## Next steps
4849

49-
{% data variables.product.github %} offers CI workflow templates for a variety of languages and frameworks.
50-
51-
Browse the complete list of CI workflow templates offered by {% data variables.product.company_short %} in the {% ifversion fpt or ghec %}[actions/starter-workflows](https://github.com/actions/starter-workflows/tree/main/ci) repository{% else %} `actions/starter-workflows` repository on {% data variables.product.prodname_dotcom_the_website %}{% endif %}.
52-
53-
## Further reading
54-
55-
* [AUTOTITLE](/actions/use-cases-and-examples/building-and-testing){% ifversion fpt or ghec %}
56-
* [AUTOTITLE](/billing/managing-billing-for-github-actions){% endif %}
50+
{% data variables.product.github %} offers CI workflow templates for a variety of languages and frameworks. For tutorials on setting up continuous integration with these templates, see [AUTOTITLE](/actions/use-cases-and-examples/building-and-testing).

content/actions/concepts/overview/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ versions:
88
ghec: '*'
99
children:
1010
- /about-continuous-deployment-with-github-actions
11-
- /about-continuous-integration-with-github-actions
11+
- /continuous-integration
1212
- /usage-limits-billing-and-administration
1313
---

content/actions/concepts/use-cases/deploying-with-github-actions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ For more information, see [AUTOTITLE](/actions/using-workflows/events-that-trigg
5959
6060
{% data reusables.actions.about-environments %}
6161
62+
You can configure environments with protection rules and secrets. When a workflow job references an environment, the job won't start until all of the environment's protection rules pass. A job also cannot access secrets that are defined in an environment until all the deployment protection rules pass. To learn more, see [Using custom deployment protection rules](#using-custom-deployment-protection-rules) in this article.
63+
6264
## Using concurrency
6365
6466
Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. You can use concurrency so that an environment has a maximum of one deployment in progress and one deployment pending at a time. For more information about concurrency, see [AUTOTITLE](/actions/using-jobs/using-concurrency).
@@ -142,6 +144,30 @@ Every workflow run generates a real-time graph that illustrates the run progress
142144

143145
You can also view the logs of each workflow run and the history of workflow runs. For more information, see [AUTOTITLE](/actions/monitoring-and-troubleshooting-workflows/viewing-workflow-run-history).
144146

147+
## Using required reviews in workflows
148+
149+
Jobs that reference an environment configured with required reviewers will wait for an approval before starting. While a job is awaiting approval, it has a status of "Waiting". If a job is not approved within 30 days, it will automatically fail.
150+
151+
For more information about environments and required approvals, see [AUTOTITLE](/actions/deployment/targeting-different-environments/managing-environments-for-deployment). For information about how to review deployments with the REST API, see [AUTOTITLE](/rest/actions/workflow-runs).
152+
153+
## Using custom deployment protection rules
154+
155+
{% data reusables.actions.custom-deployment-protection-rules-beta-note %}
156+
157+
{% data reusables.actions.about-custom-deployment-protection-rules %}
158+
159+
Custom deployment protection rules are powered by {% data variables.product.prodname_github_apps %} and run based on webhooks and callbacks. Approval or rejection of a workflow job is based on consumption of the `deployment_protection_rule` webhook. For more information, see [AUTOTITLE](/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_protection_rule) and [Approving or rejecting deployments](/actions/how-tos/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules#approving-or-rejecting-deployments).
160+
161+
Once you have created a custom deployment protection rule and installed it on your repository, the custom deployment protection rule will automatically be available for all environments in the repository.
162+
163+
Deployments to an environment can be approved or rejected based on the conditions defined in any external service like an approved ticket in an IT Service Management (ITSM) system, vulnerable scan result on dependencies, or stable health metrics of a cloud resource. The decision to approve or reject deployments is at the discretion of the integrating third-party application and the gating conditions you define in them. The following are a few use cases for which you can create a deployment protection rule.
164+
165+
* ITSM & Security Operations: you can check for service readiness by validating quality, security, and compliance processes that verify deployment readiness.
166+
* Observability systems: you can consult monitoring or observability systems (Asset Performance Management Systems and logging aggregators, cloud resource health verification systems, etc.) for verifying the safety and deployment readiness.
167+
* Code quality & testing tools: you can check for automated tests on CI builds which need to be deployed to an environment.
168+
169+
Alternatively, you can write your own protection rules for any of the above use cases or you can define any custom logic to safely approve or reject deployments from pre-production to production environments.
170+
145171
## Tracking deployments through apps
146172

147173
{% ifversion fpt or ghec %}

content/actions/concepts/use-cases/using-github-actions-for-project-management.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ Workflows can do many things, such as commenting on an issue, adding or removing
3535

3636
You can learn about using {% data variables.product.prodname_actions %} for project management by following these tutorials, which include example workflows that you can adapt to meet your needs.
3737

38-
* [AUTOTITLE](/actions/managing-issues-and-pull-requests/adding-labels-to-issues){%- ifversion projects-v1 %}
39-
* [AUTOTITLE](/actions/managing-issues-and-pull-requests/removing-a-label-when-a-card-is-added-to-a-project-board-column)
40-
* [AUTOTITLE](/actions/managing-issues-and-pull-requests/moving-assigned-issues-on-project-boards){% endif %}
38+
* [AUTOTITLE](/actions/managing-issues-and-pull-requests/adding-labels-to-issues)
4139
* [AUTOTITLE](/actions/managing-issues-and-pull-requests/commenting-on-an-issue-when-a-label-is-added)
4240
* [AUTOTITLE](/actions/managing-issues-and-pull-requests/closing-inactive-issues)
4341
* [AUTOTITLE](/actions/managing-issues-and-pull-requests/scheduling-issue-creation)

content/actions/how-tos/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,11 @@ redirect_from:
1616
- /actions/managing-workflow-runs-and-deployments/managing-deployments/creating-custom-deployment-protection-rules
1717
---
1818

19-
{% data reusables.actions.custom-deployment-protection-rules-beta-note %}
20-
21-
## About custom deployment protection rules
22-
23-
{% data reusables.actions.about-custom-deployment-protection-rules %}
24-
25-
Custom deployment protection rules are powered by {% data variables.product.prodname_github_apps %} and run based on webhooks and callbacks. Approval or rejection of a workflow job is based on consumption of the `deployment_protection_rule` webhook. For more information, see [AUTOTITLE](/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_protection_rule) and [Approving or rejecting deployments](#approving-or-rejecting-deployments).
19+
## Prerequisites
2620

27-
Once you have created a custom deployment protection rule and installed it on your repository, the custom deployment protection rule will automatically be available for all environments in the repository.
28-
29-
## Using custom deployment protection rules to approve or reject deployments
30-
31-
Deployments to an environment can be approved or rejected based on the conditions defined in any external service like an approved ticket in an IT Service Management (ITSM) system, vulnerable scan result on dependencies, or stable health metrics of a cloud resource. The decision to approve or reject deployments is at the discretion of the integrating third-party application and the gating conditions you define in them. The following are a few use cases for which you can create a deployment protection rule.
32-
33-
* ITSM & Security Operations: you can check for service readiness by validating quality, security, and compliance processes that verify deployment readiness.
34-
* Observability systems: you can consult monitoring or observability systems (Asset Performance Management Systems and logging aggregators, cloud resource health verification systems, etc.) for verifying the safety and deployment readiness.
35-
* Code quality & testing tools: you can check for automated tests on CI builds which need to be deployed to an environment.
21+
{% data reusables.actions.custom-deployment-protection-rules-beta-note %}
3622

37-
Alternatively, you can write your own protection rules for any of the above use cases or you can define any custom logic to safely approve or reject deployments from pre-production to production environments.
23+
For general information about deployment protection rules, see [AUTOTITLE](/actions/concepts/use-cases/deploying-with-github-actions#using-custom-deployment-protection-rules).
3824

3925
## Creating a custom deployment protection rule with {% data variables.product.prodname_github_apps %}
4026

0 commit comments

Comments
 (0)