-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
52 lines (50 loc) · 2.13 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
name: 'Filename Inspector'
description: 'Scans files to ensure naming conventions, reporting any files missing specified name patterns.'
inputs:
name-patterns:
description: 'List of patterns that tested file name should have, separated by commas (e.g., "*UnitTest.*,*IntegrationTest.*").'
required: true
paths:
description: 'List of glob patterns of paths to include to control, separated by commas (e.g., "**/src/test/**/*.java,**/src/test/**/*.py").'
required: true
excludes:
description: 'List of patterns paths to exclude from controls, separated by commas (e.g., "src/exclude_dir/*.py,tests/exclude_file.py").'
required: false
default: ''
report-format:
description: 'Specifies the format of the output report. Options: console, csv, and json.'
required: false
default: 'console'
verbose-logging:
description: 'Enable verbose logging to provide detailed output during the action’s execution, aiding in troubleshooting and setup.'
required: false
default: 'false'
fail-on-violation:
description: 'Set to true to fail the action if any convention violations are detected. Set to false to continue without failure.'
required: false
default: 'false'
outputs:
violation-count:
description: 'Count of files that do not comply with the specified file name conventions.'
value: ${{ steps.filename-inspector.outputs.violation-count }}
report-path:
description: "Path to the generated report file. Not used when 'console' is selected as the report format."
value: ${{ steps.filename-inspector.outputs.report-path }}
branding:
icon: 'book'
color: 'yellow'
runs:
using: 'composite'
steps:
- name: Scan files
id: filename-inspector
env:
INPUT_NAME_PATTERNS: ${{ inputs.name-patterns }}
INPUT_PATHS: ${{ inputs.paths }}
INPUT_EXCLUDES: ${{ inputs.excludes }}
INPUT_REPORT_FORMAT: ${{ inputs.report-format }}
INPUT_VERBOSE_LOGGING: ${{ inputs.verbose-logging }}
INPUT_FAIL_ON_VIOLATION: ${{ inputs.fail-on-violation }}
run: |
python3 ${{ github.action_path }}/src/filename_inspector.py
shell: bash