-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
52 lines (48 loc) · 1.51 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: 'Validate JSON data inside YAML files'
description: 'Github Action detects and validates JSON data inside the YAML files.'
author: 'Dung Pham'
inputs:
folder_or_file:
description: 'File(s) or Directory, separate by space if multiple files or folder are specified'
required: false
format:
description: 'Format for parsing output [parsable,standard,colored,github,auto]'
required: false
default: "parsable"
strict:
description: 'Return non-zero exit code on warnings as well as errors'
required: false
default: "false"
no_warnings:
description: 'Output only error level problems'
required: false
default: "false"
outputs:
logfile:
description: "Lint JSON data log file path"
value: ${{ steps.lintjson-data.outputs.logfile }}
runs:
using: 'composite'
steps:
- name: Install Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.12.0-rc.3'
- id: lintjson-data
run: |
if [[ -d "/__w/_actions" ]]; then
# This is a self-hosted container runner
python ${GITHUB_ACTION_PATH}/main.py
else
# This is a vm runner
python ${{ github.action_path }}/main.py
fi
shell: bash
env:
INPUT_FILE_OR_DIR: ${{ inputs.folder_or_file }}
INPUT_FORMAT: ${{ inputs.format }}
INPUT_STRICT: ${{ inputs.strict }}
INPUT_NO_WARNINGS: ${{ inputs.no_warnings }}
branding:
color: blue
icon: check-square