diff --git a/Dockerfile b/Dockerfile index 8768f6428c9d..e716e9e62ce3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ # -------------------------------------------------------------------------------- # To update the sha, run `docker pull node:$VERSION-alpine` # look for something like: `Digest: sha256:0123456789abcdef` -FROM node:20-alpine@sha256:7e227295e96f5b00aa79555ae166f50610940d888fc2e321cf36304cbd17d7d6 as base +FROM node:20-alpine@sha256:ec0c413b1d84f3f7f67ec986ba885930c57b5318d2eb3abc6960ee05d4f2eb28 as base # This directory is owned by the node user ARG APP_HOME=/home/node/app diff --git a/content/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners.md b/content/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners.md index 5cb755fcc0d6..974d7fb60116 100644 --- a/content/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners.md +++ b/content/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners.md @@ -85,7 +85,7 @@ You can choose from several specifications for {% data variables.actions.hosted_ | --- | ------------- | ------------- | --------------------- | | 6 | 14 GB | 14 GB | macOS | | 12 | 30 GB | 14 GB | macOS | -| 2 | 8 GB | 14 GB | Ubuntu | +| 2 | 8 GB | 75 GB | Ubuntu | | 4 | 16 GB | 150 GB | Ubuntu, Windows | | 8 | 32 GB | 300 GB | Ubuntu, Windows | | 16 | 64 GB | 600 GB | Ubuntu, Windows | diff --git a/src/content-render/liquid/data.js b/src/content-render/liquid/data.js index a819fe5b4b97..afeb9ec5c0dc 100644 --- a/src/content-render/liquid/data.js +++ b/src/content-render/liquid/data.js @@ -28,34 +28,62 @@ export default { } return } + text = text.trim() - // Any time what we're about to replace in here has more than one line, - // if the use of `{% data ... %}` was itself indented, from the left, - // keep *that* indentation, in replaced output, for every line. - // - // For example: - // - // 1. Bullet point - // {% data variables.foo.bar %} - // - // In this example, the `{% data ...` starts with 3 whitespaces - // (based on the `1. Bull...` in the example). So put 3 whitespaces - // in front every line of the output. - if (text.split('\n').length > 0) { - const { input, begin } = this.tagToken - let i = 1 - while (input.charAt(begin - i) === ' ') { - i++ // this goes one character "to the left" - } - const goBack = input.slice(begin - i, begin) - if (goBack.charAt(0) === '\n' && goBack.length > 1) { - const numSpaces = goBack.length - 1 - text = text.trim().replace(/^/gm, ' '.repeat(numSpaces)).trim() - } - } else { - text = text.trim() - } + text = handleIndent(this.tagToken, text) + text = handleBlockquote(this.tagToken, text) return this.liquid.parseAndRender(text, scope.environments) }, } + +function handleIndent(tagToken, text) { + // Any time what we're about to replace in here has more than one line, + // if the use of `{% data ... %}` was itself indented, from the left, + // keep *that* indentation, in replaced output, for every line. + // + // For example: + // + // 1. Bullet point + // {% data variables.foo.bar %} + // + // In this example, the `{% data ...` starts with 3 whitespaces + // (based on the `1. Bull...` in the example). So put 3 whitespaces + // in front every line of the output. + if (text.split('\n').length === 0) return text + const { input, begin } = tagToken + let i = 1 + while (input.charAt(begin - i) === ' ') { + i++ // this goes one character "to the left" + } + const goBack = input.slice(begin - i, begin) + if (goBack.charAt(0) === '\n' && goBack.length > 1) { + const numSpaces = goBack.length - 1 + return text.replace(/^/gm, ' '.repeat(numSpaces)).trim() + } + return text +} + +// When a reusable has multiple lines, and the input line is a blockquote, +// keep the blockquote character on every successive line. +const blockquoteRegexp = /^\n?([ \t]*>[ \t]?)/ +function handleBlockquote(tagToken, text) { + // If the text isn't multiline, skip + if (text.split('\n').length <= 1) return text + + // If the line with the liquid tag starts with a blockquote... + const { input, content } = tagToken + const inputLine = input.split('\n').find((line) => line.includes(content)) + if (!blockquoteRegexp.test(inputLine)) return text + + // Keep the character on successive lines + const start = inputLine.match(blockquoteRegexp)[0] + return text + .split('\n') + .map((line, i) => { + if (i === 0) return line + if (blockquoteRegexp.test(line)) return line + return start + line.trim() + }) + .join('\n') +}