-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaction.yaml
More file actions
60 lines (50 loc) · 2.03 KB
/
action.yaml
File metadata and controls
60 lines (50 loc) · 2.03 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
name: "Fossa Scan"
description: "Runs a Fossa scan using FOSSA_API_KEY and SCA_FOSSA_* env vars."
inputs: {}
runs:
using: "composite"
steps:
- name: Fossa - Preparation step
shell: bash
run: |
echo "::group::⚙️ Fossa Preparation"
# Check if FOSSA CLI is already installed
if command -v fossa &> /dev/null; then
FOSSA_VERSION=$(fossa --version 2>&1 | head -n1 || echo "unknown")
echo "✓ FOSSA CLI already installed: $FOSSA_VERSION"
else
echo "Installing FOSSA CLI..."
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
fi
# Use the parameter parser script for analyze command
export FOSSA_PARAMS_CONFIG="${GITHUB_ACTION_PATH}/fossa-params.json"
source "${GITHUB_ACTION_PATH}/parse-fossa-params.sh"
# Build analyze args
build_fossa_args "analyze"
echo "SCA_FOSSA_ADDITIONAL_ARGS=${FOSSA_CLI_ARGS}" >> "$GITHUB_ENV"
# Build test args
build_fossa_args "test"
echo "SCA_FOSSA_TEST_ARGS=${FOSSA_CLI_ARGS}" >> "$GITHUB_ENV"
echo "::endgroup::"
- name: Fossa - Scan
shell: bash
working-directory: ${{ env.SCA_FOSSA_PATH || '.' }}
run: |
echo "::group::🔍 Fossa Scan"
if [ -n "${{ env.SCA_FOSSA_PATH }}" ]; then
echo "Scanning from directory: ${{ env.SCA_FOSSA_PATH }}"
fi
FOSSA_CMD="fossa analyze"
echo "Running: $FOSSA_CMD $SCA_FOSSA_ADDITIONAL_ARGS"
$FOSSA_CMD $SCA_FOSSA_ADDITIONAL_ARGS
echo "::endgroup::"
- name: FOSSA - Scan Wait For Results
if: ${{ env.SCA_FOSSA_SKIP_TEST != 'true' }}
continue-on-error: ${{ env.SCA_FOSSA_FAIL_ON_ISSUE != 'true' }}
shell: bash
working-directory: ${{ env.SCA_FOSSA_PATH || '.' }}
run: |
echo "::group::⏳ Fossa Wait For Results"
echo "Running: fossa test $SCA_FOSSA_TEST_ARGS"
fossa test $SCA_FOSSA_TEST_ARGS
echo "::endgroup::"