-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
86 lines (81 loc) · 3.2 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# JBZoo Toolbox - Csv-Blueprint.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @see https://github.com/JBZoo/Csv-Blueprint
#
name: 'CSV Blueprint - Lint and validate by schemas'
description: 'Strict and flexible schema-based CSV file validation with the ability to report as GitHub Annotations in your PRs.'
author: 'Denis Smetannikov <[email protected]>'
branding:
icon: 'file-text'
color: 'green'
inputs:
csv:
description: |
Specify the path(s) to the CSV files you want to validate.
This can include a direct path to a file or a directory to search with a maximum depth of 10 levels.
Examples: p/file.csv; p/*.csv; p/**/*.csv; p/**/name-*.csv; **/*.csv
required: true
schema:
description: |
Specify the path(s) to the schema file(s), supporting YAML, JSON, or PHP formats.
Similar to CSV paths, you can direct to specific files or search directories with glob patterns.
Examples: p/file.yml; p/*.yml; p/**/*.yml; p/**/name-*.yml; **/*.yml
required: true
report:
description: 'Report format. Available options: text, table, github, gitlab, teamcity, junit.'
default: table
required: true
apply-all:
description: |
Apply all schemas (also without `filename_pattern`) to all CSV files found as global rules.
Available options:
auto: If no glob pattern (*) is used for --schema, the schema is applied to all found CSV files.
yes: Apply all schemas to all CSV files, Schemas without `filename_pattern` are applied as a global rule.
no: Apply only schemas with not empty `filename_pattern` and match the CSV files.
default: auto
required: true
quick:
description: 'Quick mode. It will not validate all rows. It will stop after the first error.'
default: no
required: true
skip-schema:
description: 'Skip schema validation. If you are sure that the schema is correct, you can skip this check.'
default: no
required: true
# Only for debbuging and profiling
extra:
description: |
Extra options for the CSV Blueprint. Only for debbuging and profiling.
Available options:
Add flag `--parallel` if you want to validate CSV files in parallel.
Add flag `--dump-schema` if you want to see the final schema after all includes and inheritance.
Add flag `--debug` if you want to see more really deep details.
Add flag `--profile` if you want to see profiling info. Add details with `-vvv`.
Verbosity level: Available options: `-v`, `-vv`, `-vvv`
ANSI output. You can disable ANSI colors if you want with `--no-ansi`.
default: 'options: --ansi'
runs:
using: 'docker'
image: 'docker://jbzoo/csv-blueprint'
args:
- validate:csv
- '--csv'
- ${{ inputs.csv }}
- '--schema'
- ${{ inputs.schema }}
- '--report'
- ${{ inputs.report }}
- '--apply-all'
- ${{ inputs.apply-all }}
- '--quick'
- ${{ inputs.quick }}
- '--skip-schema'
- ${{ inputs.skip-schema }}
- ${{ inputs.extra }}