Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ src/ghes-releases/lib/enterprise-dates.json @github/docs-content-enterprise

# Requires review of #actions-oidc-integration, docs-engineering/issues/1506
# content/actions/deployment/security-hardening-your-deployments/** @github/oidc

# RAI - CELA
data/reusables/rai/** @github/legal-product
1 change: 1 addition & 0 deletions .github/actions/get-changed-files/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ runs:
- name: Gather changed files
id: get_changes
env:
INPUT_FILES: ${{ inputs.files }}
INPUT_HEAD: ${{ inputs.head || github.event.pull_request.head.ref || github.event.merge_group.head_ref || github.ref_name }}
INPUT_OUTPUT_FILE: ${{ inputs.output_file }}
shell: bash
Expand Down
Binary file added assets/images/banner-images/hero-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/banner-images/hero-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/banner-images/hero-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/banner-images/hero-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/banner-images/hero-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Your workflow will need to use the `upload-sarif` action, which is part of the `
* `sarif_file`, which configures the file or directory of SARIF files to be uploaded. The directory or file path is relative to the root of the repository.
* `category` (optional), which assigns a category for results in the SARIF file. This enables you to analyze the same commit in multiple ways and review the results using the {% data variables.product.prodname_code_scanning %} views in {% data variables.product.prodname_dotcom %}. For example, you can analyze using multiple tools, and in mono-repos, you can analyze different slices of the repository based on the subset of changed files.

For more information, see the [`upload-sarif` action](https://github.com/github/codeql-action/tree/v3/upload-sarif).
For more information, see the [`upload-sarif` action](https://github.com/github/codeql-action/tree/v4/upload-sarif).

The `upload-sarif` action can be configured to run when the `push` and `scheduled` event occur. For more information about {% data variables.product.prodname_actions %} events, see [AUTOTITLE](/actions/using-workflows/events-that-trigger-workflows).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ This table lists the secrets supported by {% data variables.product.prodname_sec

| Provider | Token |
|----------|:--------------------|
| Generic | ec_private_key |
| Generic | http_basic_authentication_header |
| Generic | http_bearer_authentication_header |
| Generic | mongodb_connection_string |
Expand Down
30 changes: 24 additions & 6 deletions content/contributing/style-guide-and-content-model/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,34 @@ A CTA is an explicit direction to the user to take an immediate action, such as

For example, the CTA on [AUTOTITLE](/enterprise-cloud@latest/admin/overview/setting-up-a-trial-of-github-enterprise-cloud) links to [an enterprise sales page](https://github.com/account/enterprises/new?ref_product=ghec&ref_type=trial&ref_style=text&ref_plan=enterprise) on {% data variables.product.prodname_dotcom_the_website %}.

Style a CTA using the following format.
### Required CTA parameters

* `ref_product`:
* **Purpose**: The GitHub product the CTA leads users to.
* **Allowed values**: `copilot`, `ghec`, `desktop`
* **Example**: `ref_product=copilot`
* `ref_type`:
* **Purpose**: The type of action the CTA encourages users to take.
* **Allowed values**: `trial`, `purchase`, `engagement`
* **Example**: `ref_type=purchase`
* `ref_style`:
* **Purpose**: The way we are formatting the CTA in the docs.
* **Allowed values**: `button` or `text`
* **Example**: `ref_style=button`
* `ref_plan` (_optional_):
* **Purpose**: For links to sign up for or trial a plan, the specific plan we link to.
* **Allowed values**: `enterprise`, `business`, `pro`, `free`
* **Example**: `ref_plan=business`

Replace the placeholders with the relevant information for your CTA, where `DESTINATION/URL` is the URL that the button should navigate to:

```html
{% raw %}<a href="https://github.com/DESTINATION/URL?ref_cta=CTA+NAME&ref_loc=LOCATION&ref_page=docs" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Try PRODUCT NAME</span> {% octicon "link-external" height:16 %}</a>{% endraw %}
{% raw %}<a href="https://github.com/DESTINATION/URL?ref_product=PRODUCT&ref_type=TYPE&ref_style=STYLE&ref_plan=PLAN" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Try PRODUCT NAME</span> {% octicon "link-external" height:16 %}</a>{% endraw %}
```

Replace the placeholders with the relevant information for your CTA.
* `DESTINATION/URL`: The URL that the button should navigate to.
* `CTA+NAME`: The name of the CTA. For example, `GHEC+trial` or `Copilot+Business+Trial`.
* `LOCATION`: The location in {% data variables.product.prodname_docs %} of the CTA. For example, `Setting+up+a+trial+of+GitHub+Enterprise+Cloud`.
### Getting help with CTAs

For help building a valid CTA URL, you can enter the command `npm run cta-builder` in your docs repo checkout. Answer each question and at the end you'll see your valid CTA.

## Code

Expand Down
2 changes: 1 addition & 1 deletion content/copilot/get-started/choose-enterprise-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ When you've determined whether premium requests and {% data variables.copilot.co

Sign up:

<a href="https://github.com/github-copilot/purchase?priority=business&cft=copilot_li.copilot_plans.cfb" target="_blank" class="btn btn-outline mt-3 mr-3 no-underline"><span>Copilot Business</span></a> <a href="https://github.com/github-copilot/purchase?priority=enterprise&cft=copilot_li.copilot_plans.ce" target="_blank" class="btn btn-outline mt-3 mr-3 no-underline"><span>Copilot Enterprise</span></a>
<a href="https://github.com/github-copilot/purchase?ref_product=copilot&ref_type=purchase&ref_style=button&ref_plan=business" target="_blank" class="btn btn-outline mt-3 mr-3 no-underline"><span>Copilot Business</span></a> <a href="https://github.com/github-copilot/purchase?ref_product=copilot&ref_type=purchase&ref_style=button&ref_plan=enterprise" target="_blank" class="btn btn-outline mt-3 mr-3 no-underline"><span>Copilot Enterprise</span></a>

{% endnote %}

Expand Down
6 changes: 3 additions & 3 deletions content/copilot/get-started/plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Start using {% data variables.product.prodname_copilot_short %} by signing up fo

* **{% data variables.copilot.copilot_free_short %}** — Try {% data variables.product.prodname_copilot_short %} with limited features and requests. [Start using {% data variables.copilot.copilot_free_short %}](https://github.com/copilot).

* **{% data variables.copilot.copilot_pro_short %}** — Get unlimited completions and access to premium models. Includes a free 30-day trial for eligible users. [Try {% data variables.copilot.copilot_pro_short %} for free](https://github.com/github-copilot/signup?ref_product=copilot&ref_type=trial&ref_style=text).
* **{% data variables.copilot.copilot_pro_short %}** — Get unlimited completions and access to premium models. Includes a free 30-day trial for eligible users. [Try {% data variables.copilot.copilot_pro_short %} for free](https://github.com/github-copilot/signup?ref_product=copilot&ref_type=trial&ref_style=text&ref_plan=pro).

* **{% data variables.copilot.copilot_pro_plus_short %}** — Unlock advanced AI models, extended request limits, and extra capabilities. [Subscribe to {% data variables.copilot.copilot_pro_plus_short %}](https://github.com/github-copilot/signup?ref_product=copilot&ref_type=purchase&ref_style=text&ref_plan=pro).

* **{% data variables.copilot.copilot_business_short %}** — For teams and organizations. [Subscribe to {% data variables.copilot.copilot_business_short %}](https://github.com/github-copilot/purchase?priority=business&cft=copilot_li.copilot_plans.cfb).
* **{% data variables.copilot.copilot_business_short %}** — For teams and organizations. [Subscribe to {% data variables.copilot.copilot_business_short %}](https://github.com/github-copilot/purchase?ref_product=copilot&ref_type=purchase&ref_style=button&ref_plan=business).

* **{% data variables.copilot.copilot_enterprise_short %}** — For enterprises that need advanced features and centralized management. [Subscribe to {% data variables.copilot.copilot_enterprise_short %}](https://github.com/github-copilot/purchase?priority=enterprise&cft=copilot_li.copilot_plans.ce).
* **{% data variables.copilot.copilot_enterprise_short %}** — For enterprises that need advanced features and centralized management. [Subscribe to {% data variables.copilot.copilot_enterprise_short %}](https://github.com/github-copilot/purchase?ref_product=copilot&ref_type=purchase&ref_style=button&ref_plan=enterprise).
2 changes: 1 addition & 1 deletion content/copilot/get-started/what-is-github-copilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ There are a few ways you can start using {% data variables.product.prodname_copi
### For individuals

* **Try {% data variables.product.prodname_copilot_short %} for free**: Use {% data variables.copilot.copilot_free_short %} to explore core {% data variables.product.prodname_copilot_short %} features with no paid plan required.
* **Subscribe to a paid plan**: Upgrade to {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} for full access to premium features and more generous usage limits. You can <a href="https://github.com/github-copilot/signup?ref_product=copilot&ref_type=trial&ref_style=text" target="_blank"><span>try {% data variables.copilot.copilot_pro_short %} for free</span></a> with a one-time 30-day trial.
* **Subscribe to a paid plan**: Upgrade to {% data variables.copilot.copilot_pro_short %} or {% data variables.copilot.copilot_pro_plus_short %} for full access to premium features and more generous usage limits. You can <a href="https://github.com/github-copilot/signup?ref_product=copilot&ref_type=trial&ref_style=text&ref_plan=pro" target="_blank"><span>try {% data variables.copilot.copilot_pro_short %} for free</span></a> with a one-time 30-day trial.
* **Eligible for free {% data variables.copilot.copilot_pro_short %} access?** Students, teachers, and open source maintainers may qualify for {% data variables.copilot.copilot_pro_short %} at no cost. See [AUTOTITLE](/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/getting-free-access-to-copilot-as-a-student-teacher-or-maintainer).
* **Organization members**: If your organization or enterprise has a {% data variables.product.prodname_copilot %} plan, you can request access to {% data variables.product.prodname_copilot_short %} by going to [https://github.com/settings/copilot](https://github.com/settings/copilot) and requesting access under "Get {% data variables.product.prodname_copilot_short %} from an organization."

Expand Down
2 changes: 1 addition & 1 deletion data/reusables/actions/action-codeql-action-analyze.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github/codeql-action/analyze@v3
github/codeql-action/analyze@v4
2 changes: 1 addition & 1 deletion data/reusables/actions/action-codeql-action-autobuild.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github/codeql-action/autobuild@v3
github/codeql-action/autobuild@v4
2 changes: 1 addition & 1 deletion data/reusables/actions/action-codeql-action-init.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github/codeql-action/init@v3
github/codeql-action/init@v4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github/codeql-action/upload-sarif@v3
github/codeql-action/upload-sarif@v4
1 change: 1 addition & 0 deletions data/reusables/contributing/content-linter-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
| GHD054 | third-party-actions-reusable | Code examples with third-party actions must include disclaimer reusable | warning | actions, reusable, third-party |
| GHD055 | frontmatter-validation | Frontmatter properties must meet character limits and required property requirements | warning | frontmatter, character-limits, required-properties |
| GHD056 | frontmatter-landing-recommended | Only landing pages can have recommended articles, there should be no duplicate recommended articles, and all recommended articles must exist | error | frontmatter, landing, recommended |
| GHD057 | ctas-schema | CTA URLs must conform to the schema | error | ctas, schema, urls |
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: octicon-<icon-name> | The octicon liquid syntax used is deprecated. Use this format instead `octicon "<octicon-name>" aria-label="<Octicon aria label>"` | error | |
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: site.data | Catch occurrences of deprecated liquid data syntax. | error | |
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | developer-domain | Catch occurrences of developer.github.com domain. | error | |
Expand Down
12 changes: 6 additions & 6 deletions data/tables/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Data-driven tables
# YAML-powered tables

## Overview

Expand Down Expand Up @@ -34,7 +34,7 @@ Every data-driven table needs **three files** that work together:
|-----------|----------|---------|
| **Data file** | `data/tables/` | Stores the table content in YAML format |
| **Content file** | `content/` | Displays the table using Liquid templating |
| **Schema file** | `src/data-directory/lib/data-schemas/` | Validates the YAML structure |
| **Schema file** | `src/data-directory/lib/data-schemas/tables/` | Validates the YAML structure |

**Estimated time**: 30-60 minutes for a new table

Expand All @@ -49,7 +49,7 @@ Create a new `.yml` file in `data/tables/` with a descriptive name.
Create a YAML structure that will allow me to generate a table that looks like:
[describe your table headers, rows, and columns OR attach an example]

See src/secret-scanning/data/public-docs.yml for an example.
See data/tables/supported-code-languages.yml for an example.
```

### Step 2: Create the content display
Expand All @@ -62,22 +62,22 @@ Create a Markdown table that is dynamically rendered using Liquid code.
Pull data from data/tables/TABLE_NAME.yml.
The table should look like: [describe your desired output OR attach an example]

See content/code-security/secret-scanning/introduction/supported-secret-scanning-patterns.md for an example.
See content/get-started/learning-about-github/github-language-support.md for an example.
Liquid docs: https://shopify.github.io/liquid
```

**💡 Tip**: Iterate between Steps 1 and 2 until the table renders correctly.

### Step 3: Create the schema file

Create a `.ts` file in `src/data-directory/lib/data-schemas/` with the same name as your YAML file.
Create a `.ts` file in `src/data-directory/lib/data-schemas/tables/` with the same name as your YAML file.

**Copilot prompt template:**
```
Create a TypeScript schema following prior art under data-schemas that enforces
the structure of the data/TABLE_NAME.yml file.

See src/data-directory/lib/data-schemas/learning-tracks.ts for an example.
See src/data-directory/lib/data-schemas/tables/supported-code-languages.ts for an example.
```

## Testing and validation
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"copy-fixture-data": "tsx src/tests/scripts/copy-fixture-data.ts",
"count-translation-corruptions": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsx src/languages/scripts/count-translation-corruptions.ts",
"create-enterprise-issue": "tsx src/ghes-releases/scripts/create-enterprise-issue.ts",
"cta-builder": "tsx src/content-render/scripts/cta-builder.ts",
"debug": "cross-env NODE_ENV=development ENABLED_LANGUAGES=en nodemon --inspect src/frame/server.ts",
"delete-orphan-translation-files": "tsx src/workflows/delete-orphan-translation-files.ts",
"docsaudit": "tsx src/metrics/scripts/docsaudit.ts",
Expand Down
7 changes: 7 additions & 0 deletions src/assets/scripts/find-orphaned-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ const EXCEPTIONS = new Set([
'assets/images/social-cards/default.png',
'assets/images/social-cards/issues.png',
'assets/images/social-cards/code-security.png',
// Hero images may not be used, but we keep them around for future use
'assets/images/banner-images/hero-1.png',
'assets/images/banner-images/hero-2.png',
'assets/images/banner-images/hero-3.png',
'assets/images/banner-images/hero-4.png',
'assets/images/banner-images/hero-5.png',
'assets/images/banner-images/hero-6.png',
])

function isExceptionPath(imagePath: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
// @ts-ignore - markdownlint-rule-helpers doesn't provide TypeScript declarations
import { addError, filterTokens } from 'markdownlint-rule-helpers'
import matter from '@gr2m/gray-matter'

import type { RuleParams, RuleErrorCallback, MarkdownToken } from '@/content-linter/types'

// Adds an error object with details conditionally via the onError callback
export function addFixErrorDetail(onError, lineNumber, expected, actual, range, fixInfo) {
export function addFixErrorDetail(
onError: RuleErrorCallback,
lineNumber: number,
expected: string,
actual: string,
// Using flexible type to accommodate different range formats from various linting rules
range: [number, number] | number[] | null,
// Using any for fixInfo as markdownlint-rule-helpers accepts various fix info structures
fixInfo: any,
): void {
addError(onError, lineNumber, `Expected: ${expected}`, ` Actual: ${actual}`, range, fixInfo)
}

export function forEachInlineChild(params, type, handler) {
filterTokens(params, 'inline', (token) => {
for (const child of token.children.filter((c) => c.type === type)) {
export function forEachInlineChild(
params: RuleParams,
type: string,
// Using any for child and token types because different linting rules pass tokens with varying structures
// beyond the base MarkdownToken interface (e.g., ImageToken with additional properties)
handler: (child: any, token: any) => void,
): void {
filterTokens(params, 'inline', (token: MarkdownToken) => {
for (const child of token.children!.filter((c) => c.type === type)) {
handler(child, token)
}
})
}

export function getRange(line, content) {
export function getRange(line: string, content: string): [number, number] | null {
if (content.length === 0) {
// This function assumes that the content is something. If it's an
// empty string it can never produce a valid range.
Expand All @@ -24,15 +42,15 @@ export function getRange(line, content) {
return startColumnIndex !== -1 ? [startColumnIndex + 1, content.length] : null
}

export function isStringQuoted(text) {
export function isStringQuoted(text: string): boolean {
// String starts with either a single or double quote
// ends with either a single or double quote
// and optionally ends with a question mark or exclamation point
// because that punctuation can exist outside of the quoted string
return /^['"].*['"][?!]?$/.test(text)
}

export function isStringPunctuated(text) {
export function isStringPunctuated(text: string): boolean {
// String ends with punctuation of either
// . ? ! and optionally ends with single
// or double quotes. This also allows
Expand All @@ -41,7 +59,7 @@ export function isStringPunctuated(text) {
return /^.*[.?!]['"]?$/.test(text)
}

export function doesStringEndWithPeriod(text) {
export function doesStringEndWithPeriod(text: string): boolean {
// String ends with punctuation of either
// . ? ! and optionally ends with single
// or double quotes. This also allows
Expand All @@ -50,7 +68,7 @@ export function doesStringEndWithPeriod(text) {
return /^.*\.['"]?$/.test(text)
}

export function quotePrecedesLinkOpen(text) {
export function quotePrecedesLinkOpen(text: string | undefined): boolean {
if (!text) return false
return text.endsWith('"') || text.endsWith("'")
}
Expand Down Expand Up @@ -87,12 +105,15 @@ export function quotePrecedesLinkOpen(text) {
// { type: 'paragraph_close'}, <-- Index 5 - NOT INCLUDED
// ]
//
export function filterTokensByOrder(tokens, tokenOrder) {
const matches = []
export function filterTokensByOrder(
tokens: MarkdownToken[],
tokenOrder: string[],
): MarkdownToken[] {
const matches: MarkdownToken[] = []

// Get a list of token indexes that match the
// first token (root) in the tokenOrder array
const tokenRootIndexes = []
const tokenRootIndexes: number[] = []
const firstTokenOrderType = tokenOrder[0]
tokens.forEach((token, index) => {
if (token.type === firstTokenOrderType) {
Expand Down Expand Up @@ -125,7 +146,8 @@ export const docsDomains = ['docs.github.com', 'help.github.com', 'developer.git
// This is the format we get from Markdownlint.
// Returns null if the lines do not contain
// frontmatter properties.
export function getFrontmatter(lines) {
// Returns frontmatter as a Record with any values since YAML can contain various types
export function getFrontmatter(lines: string[]): Record<string, any> | null {
const fmString = lines.join('\n')
const { data } = matter(fmString)
// If there is no frontmatter or the frontmatter contains
Expand All @@ -134,7 +156,7 @@ export function getFrontmatter(lines) {
return data
}

export function getFrontmatterLines(lines) {
export function getFrontmatterLines(lines: string[]): string[] {
const indexStart = lines.indexOf('---')
if (indexStart === -1) return []
const indexEnd = lines.indexOf('---', indexStart + 1)
Expand Down
Loading
Loading