-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaction.yaml
More file actions
71 lines (58 loc) · 2.02 KB
/
action.yaml
File metadata and controls
71 lines (58 loc) · 2.02 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
name: "SCA Scan"
description: "Generic SCA scan entrypoint."
inputs:
scanners:
description: "Comma-separated list of scanners to run."
required: false
default: "fossa"
additional_scan_params:
description: |
Optional scanner-specific overrides, one per line:
fossa.key=value
Example:
fossa.fail_on_severity=high
fossa.project_override=custom+48578/ghcr.io/solacedev/my-image
required: false
default: ""
fossa_api_key:
description: "API Key for Fossa"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Parse additional_scan_params into env vars
if: ${{ inputs.additional_scan_params != '' }}
shell: bash
run: |
echo "::group::≣ SCA - Parsing additional_scan_params..."
# Read multiline input safely
while IFS= read -r line; do
# Skip empty lines or comment lines
if [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]]; then
continue
fi
# Must be key=value format
if [[ "$line" != *"="* ]]; then
echo "❌ Invalid additional_scan_params line (missing '='): $line"
exit 1
fi
key="${line%%=*}"
value="${line#*=}"
# Remove whitespace
key="$(echo "$key" | tr -d '[:space:]')"
value="$(echo "$value" | tr -d '\r')"
# Convert "fossa.fail_on_severity" → "SCA_FOSSA_FAIL_ON_SEVERITY"
env_key="SCA_$(echo "$key" \
| sed 's/\./_/g' \
| tr '[:lower:]' '[:upper:]')"
echo "Exporting: $env_key=$value"
# Export to GITHUB_ENV so all helper actions see it
echo "${env_key}=${value}" >> "$GITHUB_ENV"
done <<< "${{ inputs.additional_scan_params }}"
echo "::endgroup::"
- name: SCA - Run Fossa scan
if: contains(inputs.scanners, 'fossa')
uses: SolaceDev/solace-public-workflows/.github/actions/sca/fossa-scan@main
env:
FOSSA_API_KEY: ${{ inputs.fossa_api_key }}