Skip to content

Commit 1120541

Browse files
jc-clarkCopilot
andauthored
Add versioning guidance to Copilot content instructions (#61651)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 45ac83c commit 1120541

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/instructions/content.instructions.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,61 @@ Examples:
9292
* ❌ Incorrect: "The cat – which sat on a branch – smiled with a broad grin." (en dash with spaces)
9393
* ❌ Incorrect: "The cat-which sat on a branch-smiled with a broad grin." (hyphen without spaces)
9494
* ❌ Incorrect: "The cat - which sat on a branch - smiled with a broad grin." (hyphen with spaces)
95+
96+
## Versioning
97+
98+
Avoid `{% ifversion fpt %}`, `{% ifversion ghec %}`, and `{% ifversion fpt or ghec %}` in content files whenever possible. Instead of suggesting or adding version-gating within an article:
99+
100+
* Write content that applies to all versions the article is versioned for
101+
* If content is truly version-specific, consider whether it is low-harm to show it to all readers (e.g., an enterprise-only row in a reference table)
102+
* Only use `{% ifversion %}` as a last resort when content would be actively misleading for readers on a different version
103+
104+
**FPT and GHEC content**: When dotcom content applies to both products, version the page for `fpt` and `ghec` in the frontmatter. Do NOT use in-article Liquid versioning. Do NOT suggest adding `{% ifversion fpt or ghec %}` blocks as a fix for content that mentions a dotcom-only feature. Instead, suggest rewriting the content using the alternatives to inline versioning options listed below.
105+
106+
**GHES content**: If versioning is necessary for GitHub Enterprise Server content, use feature-based versioning (FBV). GHES content should rely on feature flags defined in `data/features/` rather than inline `{% ifversion ghes %}` blocks. Feature flags allow centralized control of when content appears for specific GHES releases.
107+
108+
### Alternatives to inline versioning
109+
110+
Before resorting to in-article versioning, first consider whether the content is actually different across versions. Often procedures can be simplified to work at both levels.
111+
112+
Use these strategies instead of `{% ifversion %}`, depending on the level of content:
113+
114+
**At the article level:**
115+
116+
* When the feature is only available in certain products, use the "Who can use this feature?" box to convey that the content of the article applies only to specific products
117+
* When an article only exists because the functionality is only available in older GHES releases (and not on {% data variables.product.prodname_dotcom_the_website %} or newer GHES releases), just remove that article
118+
119+
**At the heading level:**
120+
121+
* Use prose similar to "Who can use this feature?" to convey that the content of a section applies only to specific products
122+
123+
**At the paragraph or sentence level:**
124+
125+
* If you're briefly introducing a feature and then linking to an article, there's no need to specify versioning. Let readers learn availability when they follow the link, via the "Who can use this feature?" box
126+
* When necessary, start sentences with "With {% data variables.product.prodname_ghe_cloud %}...", "On {% data variables.product.prodname_dotcom_the_website %}...", etc.
127+
* End list items with "({% data variables.product.prodname_ghe_cloud %} only)", "({% data variables.product.prodname_dotcom_the_website %} only)", etc.
128+
* Specify if the feature is not available for GHES with "NAME-OF-FEATURE is not available for {% data variables.product.prodname_ghe_server %}", "... (not available in {% data variables.product.prodname_ghe_server %})", etc.
129+
130+
### Example
131+
132+
When documenting a feature that only applies to dotcom (not GHES):
133+
134+
❌ Don't wrap content in version blocks:
135+
136+
```markdown
137+
{% ifversion fpt or ghec %}
138+
139+
## Immutable subject claims
140+
141+
Repositories created after July 15, 2026 now use an immutable default subject format.
142+
143+
{% endif %}
144+
```
145+
146+
✅ Do use prose to indicate availability:
147+
148+
```markdown
149+
## Immutable subject claims
150+
151+
Repositories created after July 15, 2026 now use an immutable default subject format. This rollout does not include {% data variables.product.prodname_ghe_server %}.
152+
```

0 commit comments

Comments
 (0)