Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
53 lines (50 loc) · 2.47 KB
/
Copy pathaction.yml
File metadata and controls
53 lines (50 loc) · 2.47 KB
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
name: onsystem design system check
description: Checks the lines a pull request changes for palette colors, native elements and APIs your design system lacks.
author: Diogo Esteves
branding:
icon: check-square
color: blue
inputs:
paths:
description: Files, folders or globs to check, relative to working-directory, separated by spaces or new lines, without quotes. A folder stands for its .tsx and .jsx files, so a JavaScript app lists its .js pages too, as in `. **/*.js`.
default: .
working-directory:
description: Where to run the check, such as one app of a monorepo. The config and the default baseline are read from there.
default: .
baseline:
description: Baseline file, relative to working-directory. By default onsystem.baseline.json in the project root is used whenever it exists.
default: ''
fail-on:
description: 'Which findings fail the step: error, warning (errors or warnings) or none.'
default: error
only-changed-lines:
description: On pull requests and merge groups, report only findings on the lines the change touches. false reports every finding in the checked files.
default: 'true'
require-design-system:
description: Fail when no components or no color tokens are found, or when paths leaves no file to check, so the check cannot pass by checking nothing. An app on a component library such as MUI passes with its components alone.
default: 'true'
outputs:
errors:
description: Errors reported (on the changed lines, unless only-changed-lines is false).
value: ${{ steps.check.outputs.errors }}
warnings:
description: Warnings reported (on the changed lines, unless only-changed-lines is false).
value: ${{ steps.check.outputs.warnings }}
outside-diff:
description: Findings on lines the change does not touch, which were not reported.
value: ${{ steps.check.outputs.outside-diff }}
runs:
using: composite
steps:
# Runs the CLI version in this action's package.json, so `@v0` at a release runs that release.
- id: check
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
ONSYSTEM_ACTION_PATH: ${{ github.action_path }}
INPUT_PATHS: ${{ inputs.paths }}
INPUT_BASELINE: ${{ inputs.baseline }}
INPUT_FAIL_ON: ${{ inputs.fail-on }}
INPUT_ONLY_CHANGED_LINES: ${{ inputs.only-changed-lines }}
INPUT_REQUIRE_DESIGN_SYSTEM: ${{ inputs.require-design-system }}
run: node "$ONSYSTEM_ACTION_PATH/action/index.mjs"