Skip to content
Closed
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: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,7 @@ jobs:
ENABLED_LANGUAGES: ${{ matrix.name == 'languages' && 'all' || '' }}
ROOT: ${{ (matrix.name == 'fixtures' || matrix.name == 'article-api' || matrix.name == 'landings' ) && 'src/fixtures/fixtures' || '' }}
TRANSLATIONS_FIXTURE_ROOT: ${{ (matrix.name == 'fixtures' || matrix.name == 'article-api') && 'src/fixtures/fixtures/translations' || '' }}
# Enable debug logging when "Re-run jobs with debug logging" is used in GitHub Actions UI
# This will output additional timing and path information to help diagnose timeout issues
RUNNER_DEBUG: ${{ runner.debug }}
run: npm test -- src/${{ matrix.name }}/tests/
13 changes: 0 additions & 13 deletions content/code-security/code-quality/concepts/index.md

This file was deleted.

1 change: 0 additions & 1 deletion content/code-security/code-quality/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ topics:
- Code Quality
children:
- /get-started
- /concepts
- /how-tos
- /reference
- /tutorials
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---
title: About GitHub Code Quality
shortTitle: About Code Quality
intro: 'Use {% data variables.product.prodname_code_quality %} to flag code quality issues in pull requests and repository scans, apply {% data variables.product.prodname_copilot_short %}-powered autofixes, and enforce standards with rulesets.'
shortTitle: GitHub Code Quality
allowTitleToDifferFromFilename: true
intro: Use {% data variables.product.prodname_code_quality %} to flag code quality issues in pull requests and repository scans, apply {% data variables.product.prodname_copilot_short %}-powered autofixes, and enforce standards with rulesets.
product: '{% data reusables.gated-features.code-quality-availability %}'
versions:
feature: code-quality
topics:
- Code Quality
contentType: concepts
redirect_from:
- /code-security/code-quality/concepts/about-code-quality
- /code-security/code-quality/concepts
---

{% data reusables.code-quality.code-quality-preview-note %}
Expand Down
1 change: 1 addition & 0 deletions content/code-security/concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ contentType: concepts
children:
- /vulnerability-reporting-and-management
- supply-chain-security
- /about-code-quality
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ Change the limit on the maximum number of pull requests for version updates open

When `open-pull-requests-limit` is defined:

* {% data variables.product.prodname_dependabot %} opens pull requests up to the defined integer value.
* {% data variables.product.prodname_dependabot %} opens pull requests up to the defined integer value. A large value can be set to effectively remove the open pull request limit.
* You can temporarily disable version updates for a package manager by setting this option to zero, see [Disabling {% data variables.product.prodname_dependabot_version_updates %}](/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates#disabling-dependabot-version-updates).

## `package-ecosystem` {% octicon "versions" aria-label="Version updates only" height="24" %}
Expand Down
18 changes: 0 additions & 18 deletions content/copilot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ changelog:
introLinks:
overview: /copilot/get-started/what-is-github-copilot
quickstart: /copilot/get-started/quickstart
featuredLinks:
startHere:
- /copilot/get-started/what-is-github-copilot
- '{% ifversion fpt %}/copilot/get-started/quickstart{% endif %}'
- '{% ifversion fpt %}/copilot/tutorials/try-extensions{% endif %}'
- '{% ifversion fpt %}/copilot/concepts/agents/coding-agent{% endif %}'
- '{% ifversion ghec %}/copilot/get-started/choose-enterprise-plan{% endif %}'
- '{% ifversion ghec %}/copilot/how-tos/set-up/set-up-for-enterprise{% endif %}'
- '{% ifversion ghec %}/copilot/tutorials/coding-agent/pilot-coding-agent{% endif %}'
popular:
- /copilot/get-started/features
- '{% ifversion fpt %}/copilot/tutorials/copilot-chat-cookbook{% endif %}'
- '{% ifversion fpt %}/copilot/how-tos/get-code-suggestions/get-ide-code-suggestions{% endif %}'
- '{% ifversion fpt %}/copilot/how-tos/chat-with-copilot/chat-in-ide{% endif %}'
- '{% ifversion fpt %}/copilot/how-tos/use-copilot-for-common-tasks/use-copilot-in-the-cli{% endif %}'
- '{% ifversion ghec %}/copilot/how-tos/manage-and-track-spending/manage-request-allowances{% endif %}'
- '{% ifversion ghec %}/copilot/tutorials/roll-out-at-scale/enable-developers/drive-adoption{% endif %}'
- '{% ifversion ghec %}/copilot/tutorials/roll-out-at-scale/enable-developers/integrate-ai-agents{% endif %}'
layout: discovery-landing
heroImage: /assets/images/banner-images/hero-6
versions:
Expand Down
9 changes: 0 additions & 9 deletions content/enterprise-onboarding/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
---
title: Enterprise onboarding
intro: 'Onboard your company to {% data variables.product.prodname_ghe_cloud %} by following our recommended plan. You will set up teams with the access they need, create a policy framework to ensure compliance, and automate processes securely throughout your enterprise.'
featuredLinks:
startHere:
- '/enterprise-onboarding/getting-started-with-your-enterprise'
- '/enterprise-onboarding/adding-users-to-your-enterprise'
- '/enterprise-onboarding/setting-up-organizations-and-teams'
- '/enterprise-onboarding/support-for-your-enterprise'
popular:
- '/enterprise-onboarding/govern-people-and-repositories'
- '/enterprise-onboarding/github-actions-for-your-enterprise'
layout: journey-landing
journeyTracks:
- id: 'getting_started'
Expand Down
2 changes: 2 additions & 0 deletions content/rest/copilot/copilot-usage-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ autogenerated: rest
allowTitleToDifferFromFilename: true
---

{% data reusables.copilot.usage-metrics-preview %}

To enable these endpoints, the "{% data variables.product.prodname_copilot_short %} usage metrics" policy must be set to **Enabled everywhere** for the enterprise. See [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-enterprise-policies#defining-policies-for-your-enterprise).

<!-- Content after this section is automatically generated -->

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ redirect_from:
- /github/site-policy/github-privacy-statement
- /site-policy/privacy-policies/global-privacy-practices
- /site-policy/privacy-policies/github-privacy-statement
- /site-policy/privacy-policies/github-codespaces-privacy-statement
versions:
fpt: '*'
topics:
Expand Down
1 change: 0 additions & 1 deletion content/site-policy/privacy-policies/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ children:
- /github-general-privacy-statement
- /github-subprocessors
- /github-cookies
- /github-codespaces-privacy-statement
- /github-candidate-privacy-policy
redirect_from:
- /github/site-policy/github-data-protection-addendum
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"generate-code-quality-query-list": "tsx src/codeql-queries/scripts/generate-code-quality-query-list.ts",
"generate-content-linter-docs": "tsx src/content-linter/scripts/generate-docs.ts",
"move-content": "tsx src/content-render/scripts/move-content.ts",
"move-by-content-type": "tsx src/content-render/scripts/move-by-content-type.ts",
"openapi-docs": "tsx src/rest/docs.ts",
"playwright-test": "playwright test --config src/fixtures/playwright.config.ts --project=\"Google Chrome\"",
"lint-report": "tsx src/content-linter/scripts/lint-report.ts",
Expand All @@ -78,7 +79,7 @@
"release-banner": "tsx src/ghes-releases/scripts/release-banner.ts",
"repo-sync": "./src/workflows/local-repo-sync.sh",
"reusables": "tsx src/content-render/scripts/reusables-cli.ts",
"resolve-liquid": "tsx src/content-render/scripts/resolve-liquid.ts",
"liquid-tags": "tsx src/content-render/scripts/liquid-tags.ts",
"rendered-content-link-checker": "tsx src/links/scripts/rendered-content-link-checker.ts",
"rendered-content-link-checker-cli": "tsx src/links/scripts/rendered-content-link-checker-cli.ts",
"rest-dev": "tsx src/rest/scripts/update-files.ts",
Expand Down
10 changes: 9 additions & 1 deletion src/ai-tools/lib/file-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function mergeFrontmatterProperties(filePath: string, newPropertiesYaml:
)
}

if (!parsed.content) {
if (parsed.content === undefined || parsed.content === null) {
throw new Error('Failed to parse content from file')
}

Expand Down Expand Up @@ -133,9 +133,11 @@ export function mergeFrontmatterProperties(filePath: string, newPropertiesYaml:
const formattedValue = typeof value === 'string' ? `'${value.replace(/'/g, "''")}'` : value

// Find the line with this field
let foundField = false
for (let i = 1; i < frontmatterEndIndex; i++) {
const line = lines[i]
if (line.startsWith(`${key}:`)) {
foundField = true
// Simple replacement: keep the field name and spacing, replace the value
const colonIndex = line.indexOf(':')
const leadingSpace = line.substring(colonIndex + 1, colonIndex + 2) // Usually a space
Expand All @@ -150,6 +152,12 @@ export function mergeFrontmatterProperties(filePath: string, newPropertiesYaml:
break
}
}

// If field doesn't exist, add it before the closing ---
if (!foundField && frontmatterEndIndex > 0) {
lines.splice(frontmatterEndIndex, 0, `${key}: ${formattedValue}`)
frontmatterEndIndex++
}
}

return lines.join('\n')
Expand Down
62 changes: 62 additions & 0 deletions src/ai-tools/lib/prompt-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { fileURLToPath } from 'url'
import fs from 'fs'
import yaml from 'js-yaml'
import path from 'path'
import readFrontmatter from '@/frame/lib/read-frontmatter'
import { callModelsApi } from '@/ai-tools/lib/call-models-api'

export interface PromptMessage {
Expand Down Expand Up @@ -52,6 +53,67 @@ export function getRefinementDescriptions(editorTypes: string[]): string {
return editorTypes.join(', ')
}

/**
* Enrich context for intro prompt on index.md files
*/
export function enrichIndexContext(filePath: string, content: string): string {
if (!filePath.endsWith('index.md')) return content

try {
const { data } = readFrontmatter(content)
if (!data) return content

// Extract product name from file path (e.g., content/github-models/ -> "GitHub Models")
const productMatch = filePath.replace(/\\/g, '/').match(/content\/([^/]+)/)
const productName = productMatch
? productMatch[1]
.split('-')
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
.join(' ')
: ''

// Get child article titles
const titles: string[] = []
if (data.children && Array.isArray(data.children)) {
const dir = path.dirname(filePath)
for (const childPath of data.children.slice(0, 20)) {
try {
const childFile = path.join(dir, `${childPath.replace(/^\//, '')}.md`)
const childContent = fs.readFileSync(childFile, 'utf8')
const { data: childData } = readFrontmatter(childContent)
if (childData?.title) titles.push(childData.title)
} catch (error) {
if (process.env.AI_TOOLS_VERBOSE === 'true') {
console.warn('Failed to read or parse child article for intro context:', {
filePath,
childPath,
error,
})
}
}
}
}

// Build context note
const parts: string[] = []
if (productName) parts.push(`Product: ${productName}`)
if (titles.length > 0) parts.push(`Child articles: ${titles.join(', ')}`)

if (parts.length > 0) {
return `\n\n---\nContext for intro generation:\n${parts.join('\n')}\n---\n\n${content}`
}
} catch (error) {
if (process.env.AI_TOOLS_VERBOSE === 'true') {
console.warn('Failed to enrich index context for intro generation:', {
filePath,
error,
})
}
}

return content
}

/**
* Call an editor with the given content and options
*/
Expand Down
38 changes: 38 additions & 0 deletions src/ai-tools/prompts/content-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Your job is to read through GitHub Docs articles that I provide and figure out what content type it _most_ aligns to and add the frontmatter property `contentType` with an appropriate value.

**Available `contentType` values (MUST choose from this exact list):**

- 'get-started' (MANDATORY for files with "quickstart" in the filename; also use for other getting started content)
- 'concepts' (use for files with "about" in the filename; also use for other conceptual content)
- 'how-tos' (use for procedural content AND for subdirectory index.md files that have a `children` array)
- 'rai' (optional - only applies to files with "responsible-use" or "rai" in the filenames)
- 'reference'
- 'tutorials'

There is one additional type, 'landing', which can ONLY be used on top-level product index.md files: 'content/<product>/index.md'

**CRITICAL RULE**: If a file is an index.md with MORE than three directory parts (e.g., 'content/<product>/<subdirectory>/index.md'), it is a subdirectory index and should use 'how-tos', NOT 'landing'. The fact that it has a `children` array does NOT make it a landing page.

For prior art, see the following file sets:

- content/copilot/
- content/actions/
- content/account-and-profile/
- content/integrations/

## Output format

**Important:** Output ONLY the new frontmatter property that should be added to the file. Do not output the entire file content.

```yaml
contentType: [selected option]
```

<!-- IF_WRITE_MODE -->
**CRITICAL**: You are in write mode. Output ONLY the YAML frontmatter properties to update.
- Return just the YAML property in the format above
- Do NOT include analysis, explanations, or formatting
- Do NOT wrap in markdown code blocks or ```yaml
- Do NOT include the analysis format
- Just return the clean YAML properties for merging
<!-- END_WRITE_MODE -->
Loading
Loading