-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
111 lines (104 loc) · 3.5 KB
/
Copy pathaction.yml
File metadata and controls
111 lines (104 loc) · 3.5 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: "EEG - AI Security Scanner"
description: "Static AI/agent security scan via the EEG CLI (SARIF/JSON). Same entry point as local eeg / python -m eeg."
author: "findthehead"
branding:
icon: "shield"
color: "blue"
inputs:
path:
description: "Repository path to scan"
required: false
default: "."
profile:
description: "Scan profile (code, agent, full, model, dep)"
required: false
default: "code"
format:
description: "Output format (json or sarif)"
required: false
default: "sarif"
output:
description: "Report file path"
required: false
default: "eeg-results.sarif"
fail-on:
description: "Fail when findings meet this severity (none, low, medium, high, critical, any)"
required: false
default: "high"
cloud:
description: "Optional cloud hint for full profile (aws, azure, gcp, any)"
required: false
default: ""
version:
description: "Pin eeg-security version (empty = latest from PyPI)"
required: false
default: ""
extra-args:
description: "Additional CLI arguments appended to the scan command"
required: false
default: ""
outputs:
findings-count:
description: "Total findings (best-effort from JSON summary when format=json)"
value: ${{ steps.scan.outputs.findings-count }}
critical-count:
description: "CRITICAL findings count when format=json"
value: ${{ steps.scan.outputs.critical-count }}
high-count:
description: "HIGH findings count when format=json"
value: ${{ steps.scan.outputs.high-count }}
report-file:
description: "Path to the generated report"
value: ${{ steps.scan.outputs.report-file }}
exit-code:
description: "CLI exit code"
value: ${{ steps.scan.outputs.exit-code }}
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install EEG
shell: bash
run: |
python -m pip install --upgrade pip
if [ -n "${{ inputs.version }}" ]; then
pip install "eeg-security==${{ inputs.version }}"
else
pip install eeg-security
fi
- name: Run EEG scan
id: scan
shell: bash
run: |
set +e
EXTRA=()
if [ -n "${{ inputs.cloud }}" ]; then
EXTRA+=(--cloud "${{ inputs.cloud }}")
fi
# shellcheck disable=SC2086
python -m eeg scan "${{ inputs.path }}" \
--profile "${{ inputs.profile }}" \
--format "${{ inputs.format }}" \
--output "${{ inputs.output }}" \
--fail-on "${{ inputs.fail-on }}" \
"${EXTRA[@]}" \
${{ inputs.extra-args }}
CODE=$?
echo "exit-code=$CODE" >> "$GITHUB_OUTPUT"
echo "report-file=${{ inputs.output }}" >> "$GITHUB_OUTPUT"
TOTAL="0"
CRITICAL="0"
HIGH="0"
if [ "${{ inputs.format }}" = "json" ] && [ -f "${{ inputs.output }}" ]; then
TOTAL=$(jq -r '.summary.total_findings // 0' "${{ inputs.output }}" 2>/dev/null || echo "0")
CRITICAL=$(jq -r '.summary.by_severity.CRITICAL // 0' "${{ inputs.output }}" 2>/dev/null || echo "0")
HIGH=$(jq -r '.summary.by_severity.HIGH // 0' "${{ inputs.output }}" 2>/dev/null || echo "0")
fi
echo "findings-count=$TOTAL" >> "$GITHUB_OUTPUT"
echo "critical-count=$CRITICAL" >> "$GITHUB_OUTPUT"
echo "high-count=$HIGH" >> "$GITHUB_OUTPUT"
echo "::notice::EEG scan finished (exit=$CODE, findings≈$TOTAL)"
exit "$CODE"