generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
71 lines (63 loc) · 2.21 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: 'Carbon Markdown'
description: 'Replace references to files by Carbon Now generated images'
author: 'LAFFARGUE Nicolas'
inputs:
searchPatterns:
description:
'A comma separated list of patterns used to search for Markdown files to
transform.'
required: false
default: '**/*.md'
ignorePatterns:
description: 'The list of patterns for files to exclude.'
required: false
default: 'node_modules/**'
outputFolderName:
description: 'Name of the folder used to generate Carbon images'
required: false
default: carbon
carbonConfigFile:
description: 'Path to the carbon configuration file'
required: true
defaultCarbonPreset:
description:
'Name of the default preset to use for formatting generated images'
required: true
runs:
using: composite
steps:
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Playwright
run: pnpm install -g @playwright/test
shell: bash
- name: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test -g | grep @playwright | sed 's/.*@//')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
shell: bash
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Setup Playwright with Webkit
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpx playwright install --with-deps chromium
shell: bash
- name: Install Carbon Now CLI
run: pnpm install -g carbon-now-cli --ignore-scripts
shell: bash
- name: Carbon images in Markdown files
run: node ${{github.action_path}}/dist/index.js
shell: bash
env:
SEARCH_PATTERNS: ${{ inputs.searchPatterns }}
IGNORE_PATTERNS: ${{ inputs.ignorePatterns }}
OUTPUT_FOLDER_NAME: ${{ inputs.outputFolderName }}
CARBON_CONFIG_FILE: ${{ inputs.carbonConfigFile }}
DEFAULT_CARBON_PRESET: ${{ inputs.defaultCarbonPreset }}