-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
72 lines (66 loc) · 2.04 KB
/
action.yml
File metadata and controls
72 lines (66 loc) · 2.04 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: 'Structured MADR Validator'
description: 'Validates Architectural Decision Records against the Structured MADR specification'
author: 'zircote'
branding:
icon: 'check-circle'
color: 'green'
inputs:
path:
description: 'Path to the directory containing ADR files (relative to repository root)'
required: false
default: 'docs/decisions'
pattern:
description: 'Glob pattern for ADR files'
required: false
default: '**/*.md'
schema:
description: 'Path to custom JSON Schema (uses built-in schema if not specified)'
required: false
default: ''
strict:
description: 'Enable strict mode (fail on warnings)'
required: false
default: 'false'
fail-on-error:
description: 'Fail the workflow if validation errors are found'
required: false
default: 'true'
outputs:
valid:
description: 'Whether all ADRs passed validation'
value: ${{ steps.validate.outputs.valid }}
total:
description: 'Total number of ADR files checked'
value: ${{ steps.validate.outputs.total }}
passed:
description: 'Number of ADR files that passed validation'
value: ${{ steps.validate.outputs.passed }}
failed:
description: 'Number of ADR files that failed validation'
value: ${{ steps.validate.outputs.failed }}
warnings:
description: 'Number of warnings generated'
value: ${{ steps.validate.outputs.warnings }}
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Install dependencies
shell: bash
working-directory: ${{ github.action_path }}
run: npm ci --ignore-scripts
- name: Run validation
id: validate
shell: bash
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_PATTERN: ${{ inputs.pattern }}
INPUT_SCHEMA: ${{ inputs.schema }}
INPUT_STRICT: ${{ inputs.strict }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail-on-error }}
ACTION_PATH: ${{ github.action_path }}
run: |
node "$ACTION_PATH/src/validate.js"