-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
73 lines (65 loc) · 2.16 KB
/
action.yaml
File metadata and controls
73 lines (65 loc) · 2.16 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
73
name: 'nod AI Compliance Gatekeeper'
description: 'Enforce EU AI Act, NIST, and OWASP compliance in Markdown/JSON specs.'
author: 'Your Name'
branding:
icon: 'shield'
color: 'green'
inputs:
target:
description: 'Path to the spec file to audit (e.g., ai-spec.md)'
required: true
rules:
description: 'Path to rules file or directory. Defaults to "defaults/" or "rules.yaml".'
required: false
default: ''
strict:
description: 'Enable strict mode (checks content length)'
required: false
default: 'true'
min_severity:
description: 'Minimum severity to fail the build (MEDIUM, HIGH, CRITICAL)'
required: false
default: 'HIGH'
output_format:
description: 'Output format (text, json, sarif, compliance)'
required: false
default: 'text'
output_file:
description: 'File path to save the output (e.g. nod-results.sarif)'
required: false
default: ''
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install nod
run: pip install ${{ github.action_path }}
shell: bash
- name: Run nod
run: |
# Logic: User Input -> defaults/ -> rules.yaml
RULES="${{ inputs.rules }}"
# We need to look inside the action path for defaults if not provided
if [ -z "$RULES" ]; then
if [ -d "${{ github.action_path }}/defaults" ]; then
RULES="${{ github.action_path }}/defaults"
elif [ -f "${{ github.action_path }}/rules.yaml" ]; then
RULES="${{ github.action_path }}/rules.yaml"
fi
fi
SAVE_ARG=""
if [ -n "${{ inputs.output_file }}" ]; then
SAVE_ARG="--save-to ${{ inputs.output_file }}"
fi
echo "Running nod on ${{ inputs.target }} with rules from $RULES"
# Now we call 'nod' directly as a CLI command
nod ${{ inputs.target }} \
--rules "$RULES" \
--min-severity ${{ inputs.min_severity }} \
--output ${{ inputs.output_format }} \
${{ inputs.strict == 'true' && '--strict' || '' }} \
$SAVE_ARG
shell: bash