Skip to content

Commit 5c72e58

Browse files
authored
repo sync
2 parents 4643301 + 6c0942d commit 5c72e58

29 files changed

+53
-50
lines changed

content/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ When creating a group, you must choose a policy that defines which repositories
4848
{% warning %}
4949

5050
**Warning**
51+
5152
{% indented_data_reference site.data.reusables.github-actions.self-hosted-runner-security spaces=3 %}
53+
5254
For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories)."
5355

5456
{% endwarning %}
@@ -78,7 +80,9 @@ When creating a group, you must choose a policy that defines which organizations
7880
{% warning %}
7981

8082
**Warning**
83+
8184
{% indented_data_reference site.data.reusables.github-actions.self-hosted-runner-security spaces=3 %}
85+
8286
For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories)."
8387

8488
{% endwarning %}

data/reusables/github-actions/self-hosted-runner-configure-runner-group-access.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
{% warning %}
66

77
**Warning**
8+
89
{% indented_data_reference site.data.reusables.github-actions.self-hosted-runner-security spaces=3 %}
10+
911
For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories)."
1012

1113
{% endwarning %}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
testPathIgnorePatterns: [
2727
'node_modules/',
2828
'vendor/',
29-
'tests/helpers.js',
29+
'tests/helpers/',
3030
...isBrowser ? [] : ['tests/browser/browser.js']
3131
],
3232
testMatch: [
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
const Liquid = require('liquid')
2-
const liquid = new Liquid.Engine()
3-
const LiquidTag = require('./liquid-tag')
42
const assert = require('assert')
53

64
// This class supports a tag that expects two parameters, a data reference and `spaces=NUMBER`:
@@ -12,17 +10,14 @@ const assert = require('assert')
1210
// reference is used inside a block element (like a list or nested list) without
1311
// affecting the formatting when the reference is used elsewhere via {{ site.data.foo.bar }}.
1412

15-
module.exports = class IndentedDataReference extends LiquidTag {
16-
constructor (template, tagName, dataReferenceAndNumberOfSpaces) {
17-
super(template, tagName, dataReferenceAndNumberOfSpaces.trim())
18-
}
19-
20-
async parseTemplate (context) {
21-
const template = await this.getTemplate()
22-
13+
module.exports = class IndentedDataReference extends Liquid.Tag {
14+
async render (context) {
2315
// obfuscate first legit space, remove all other spaces, then restore legit space
2416
// this way we can support spaces=NUMBER as well as spaces = NUMBER
25-
const input = this.param.replace(/\s/, 'REALSPACE').replace(/\s/g, '').replace('REALSPACE', ' ')
17+
const input = this.markup.trim()
18+
.replace(/\s/, 'REALSPACE')
19+
.replace(/\s/g, '')
20+
.replace('REALSPACE', ' ')
2621

2722
const [dataReference, spaces] = input.split(' ')
2823

@@ -31,11 +26,16 @@ module.exports = class IndentedDataReference extends LiquidTag {
3126

3227
assert(parseInt(numSpaces) || numSpaces === '0', '"spaces=NUMBER" must include a number')
3328

34-
const renderedReference = await require('../render-content')(`{{ ${dataReference} }}`, context.environments[0])
29+
// Get the referenced value from the context
30+
const value = await context.get(dataReference)
31+
32+
// If nothing is found in the context, exit with nothing; this may
33+
// feel weird and that we should throw an error, but this is "The Liquid Way TM"
34+
if (!value) return
3535

3636
// add spaces to each line
37-
const renderedReferenceWithIndent = renderedReference.replace(/^/mg, ' '.repeat(numSpaces))
37+
const renderedReferenceWithIndent = value.replace(/^/mg, ' '.repeat(numSpaces))
3838

39-
return liquid.parseAndRender(template, { renderedReferenceWithIndent })
39+
return this.template.engine.parseAndRender(renderedReferenceWithIndent, context)
4040
}
4141
}

script/check-deps.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const path = require('path')
1717
const main = async () => {
1818
const data = await dependencyCheck({
1919
entries: [
20+
path.posix.join(__dirname, '..', '*.js'),
2021
path.posix.join(__dirname, '..', '*', '*.js'),
2122
path.posix.join('!', __dirname, '..', 'javascripts', '*.js'),
2223
path.posix.join(__dirname, '..', 'script', 'graphql', '*.js')

tests/content/featured-links.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { getDOM, getJSON } = require('../helpers')
1+
const { getDOM, getJSON } = require('../helpers/supertest')
22
const enterpriseServerReleases = require('../../lib/enterprise-server-releases')
33
const japaneseCharacters = require('japanese-characters')
44
const nonEnterpriseDefaultVersion = require('../../lib/non-enterprise-default-version')

tests/content/site-tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const revalidator = require('revalidator')
22
const schema = require('../../lib/site-tree-schema')
33
const latestEnterpriseRelease = require('../../lib/enterprise-server-releases').latest
4-
const { getJSON } = require('../helpers')
4+
const { getJSON } = require('../helpers/supertest')
55
const flat = require('flat')
66
const japaneseCharacters = require('japanese-characters')
77
const nonEnterpriseDefaultVersion = require('../../lib/non-enterprise-default-version')

tests/content/webhooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { difference } = require('lodash')
2-
const { getJSON } = require('../helpers')
2+
const { getJSON } = require('../helpers/supertest')
33
const { latest } = require('../../lib/enterprise-server-releases')
44
const allVersions = Object.values(require('../../lib/all-versions'))
55
const payloadVersions = allVersions.map(v => v.miscVersionName)

tests/helpers.js renamed to tests/helpers/supertest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
const cheerio = require('cheerio')
55
const supertest = require('supertest')
6-
const app = require('../server')
6+
const app = require('../../server')
77

88
const helpers = {}
99

tests/meta/orphan-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path')
44
describe('check for orphan tests', () => {
55
test('all tests are in sub-directories', () => {
66
// A known list of exceptions that can live outside of directories
7-
const EXCEPTIONS = ['README.md', 'helpers.js']
7+
const EXCEPTIONS = ['README.md']
88
const pathToTests = path.join(process.cwd(), 'tests')
99

1010
// Get a list of files/directories in `/tests`

0 commit comments

Comments
 (0)