Skip to content

Commit 6dbe33b

Browse files
authored
Fix bug in lint-versions test (#33798)
1 parent 5960249 commit 6dbe33b

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed

content/actions/hosting-your-own-runners/removing-self-hosted-runners.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Removing self-hosted runners
3-
intro: 'You can permanently remove a self-hosted runner from a repository{% ifversion fpt %} or organization{% elsif ghec or ghes or gahe %}, an organization, or an enterprise{% endif %}.'
3+
intro: 'You can permanently remove a self-hosted runner from a repository{% ifversion fpt %} or organization{% elsif ghec or ghes or ghae %}, an organization, or an enterprise{% endif %}.'
44
redirect_from:
55
- /github/automating-your-workflow-with-github-actions/removing-self-hosted-runners
66
- /actions/automating-your-workflow-with-github-actions/removing-self-hosted-runners

content/admin/guides.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ learningTracks:
1717
- adopting_github_actions_for_your_enterprise_ghes_and_ghae
1818
- '{% ifversion ghes %}increase_fault_tolerance{% endif %}'
1919
- '{% ifversion ghes %}improve_security_of_your_instance{% endif %}'
20-
- '{% ifversion ghes > 2.22 %}configure_github_actions{% endif %}'
21-
- '{% ifversion ghes > 2.22 %}configure_github_advanced_security{% endif %}'
20+
- '{% ifversion ghes %}configure_github_actions{% endif %}'
21+
- '{% ifversion ghes %}configure_github_advanced_security{% endif %}'
2222
includeGuides:
2323
- /admin/authentication/allowing-built-in-authentication-for-users-outside-your-identity-provider
2424
- /admin/authentication/changing-authentication-methods
@@ -148,4 +148,3 @@ includeGuides:
148148
- /admin/overview/creating-an-enterprise-account
149149
- /admin/user-management/managing-organizations-in-your-enterprise/restoring-a-deleted-organization
150150
---
151-

content/admin/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ featuredLinks:
8080
- '{% ifversion ghec %}/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise{% endif %}'
8181
- '{% ifversion ghec %}/admin/user-management/managing-organizations-in-your-enterprise/adding-organizations-to-your-enterprise{% endif %}'
8282
guideCards:
83-
- '{% ifversion ghes > 2.22 %} /admin/github-actions/getting-started-with-github-actions-for-github-enterprise-server {% elsif ghes < 3.0 %} /admin/enterprise-management/upgrading-github-enterprise-server {% endif %}'
84-
- '{% ifversion ghes > 2.22 %} /admin/packages/getting-started-with-github-packages-for-your-enterprise {% elsif ghes < 3.0 %} /admin/user-management/customizing-user-messages-for-your-enterprise {% endif %}'
85-
- '{% ifversion ghes > 2.22 %} /admin/configuration/configuring-advanced-security-features {% elsif ghes < 3.0 %} /admin/installation/setting-up-a-staging-instance {% endif %}'
83+
- '{% ifversion ghes %}/admin/github-actions/getting-started-with-github-actions-for-github-enterprise-server{% endif %}'
84+
- '{% ifversion ghes %}/admin/packages/getting-started-with-github-packages-for-your-enterprise{% endif %}'
85+
- '{% ifversion ghes %}/admin/configuration/configuring-advanced-security-features{% endif %}'
8686
- '{% ifversion ghae %}/admin/configuration/initializing-github-ae{% endif %}'
8787
- '{% ifversion ghae %}/admin/user-management/customizing-user-messages-for-your-enterprise{% endif %}'
8888
- '{% ifversion ghae %}/admin/github-actions/getting-started-with-github-actions-for-github-ae{% endif %}'
@@ -126,4 +126,3 @@ children:
126126
- /release-notes
127127
- /all-releases
128128
---
129-

script/helpers/get-liquid-conditionals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const tokenize = (str) => {
1111
// Return an array of just the conditional strings.
1212
function getLiquidConditionals(str, tagNames) {
1313
if (!tagNames) throw new Error(`Must provide a tag name!`)
14+
if (typeof str !== 'string') throw new Error('Must provide a string!')
1415
tagNames = Array.isArray(tagNames) ? tagNames : [tagNames]
1516

1617
return tokenize(str)

tests/linting/lint-versioning.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { getLiquidConditionals } from '../../script/helpers/get-liquid-condition
88
import allowedVersionOperators from '../../lib/liquid-tags/ifversion-supported-operators.js'
99
import featureVersionsSchema from '../helpers/schemas/feature-versions-schema.js'
1010
import walkFiles from '../../script/helpers/walk-files'
11-
import frontmatter from '../../lib/frontmatter.js'
1211
import cleanUpDeprecatedGhaeFlagErrors from '../../lib/temporary-ghae-deprecated-flag-error-cleanup.js'
1312
import { getDeepDataByLanguage } from '../../lib/get-data.js'
1413

@@ -66,15 +65,8 @@ describe('lint Liquid versioning', () => {
6665

6766
beforeAll(async () => {
6867
fileContents = await fs.readFile(file, 'utf8')
69-
const { data, content: bodyContent } = frontmatter(fileContents)
70-
71-
ifversionConditionals = getLiquidConditionals(data, ['ifversion', 'elsif']).concat(
72-
getLiquidConditionals(bodyContent, ['ifversion', 'elsif'])
73-
)
74-
75-
ifConditionals = getLiquidConditionals(data, 'if').concat(
76-
getLiquidConditionals(bodyContent, 'if')
77-
)
68+
ifversionConditionals = getLiquidConditionals(fileContents, ['ifversion', 'elsif'])
69+
ifConditionals = getLiquidConditionals(fileContents, 'if')
7870
})
7971

8072
// `ifversion` supports both standard and feature-based versioning.

0 commit comments

Comments
 (0)