-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
77 lines (73 loc) · 2.17 KB
/
action.yml
File metadata and controls
77 lines (73 loc) · 2.17 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
name: 'CodeAnt CI Scan'
description: 'Run CodeAnt CI security and code quality analysis on your repository'
author: 'CodeAnt'
branding:
icon: 'shield'
color: 'blue'
inputs:
access_token:
description: 'CodeAnt access token (PAT or repository token)'
required: true
api_base:
description: 'CodeAnt API base URL'
required: false
default: 'https://api.codeant.ai'
include_paths:
description: 'Comma-separated paths to include in scan'
required: false
default: ''
exclude_paths:
description: 'Comma-separated paths to exclude from scan'
required: false
default: ''
scan_timeout:
description: 'Scan timeout in seconds'
required: false
default: '300'
scanners:
description: 'Security scanners to run (sast, sca, secrets, antipatterns, iac, all)'
required: false
default: 'sast,sca'
runs:
using: 'composite'
steps:
- name: Fetch CodeAnt scan script
shell: bash
env:
API_BASE: ${{ inputs.api_base }}
run: |
curl -sS -X GET "${API_BASE}/analysis/ci/scan/script/get" \
--output start_scan.sh.b64
- name: Make script executable
shell: bash
env:
API_BASE: ${{ inputs.api_base }}
run: |
if [ "$API_BASE" = "https://api.codeant.ai" ]; then
base64 -d start_scan.sh.b64 > start_scan.sh
else
mv start_scan.sh.b64 start_scan.sh
fi
chmod +x start_scan.sh
- name: Trigger CodeAnt analysis
shell: bash
env:
ACCESS_TOKEN: ${{ inputs.access_token }}
REPO_NAME: ${{ github.repository }}
COMMIT_ID: ${{ github.event.pull_request.head.sha || github.sha }}
BRANCH: ${{ github.ref_name }}
INCLUDE_PATHS: ${{ inputs.include_paths }}
EXCLUDE_PATHS: ${{ inputs.exclude_paths }}
SCAN_TIMEOUT: ${{ inputs.scan_timeout }}
SCANNERS: ${{ inputs.scanners }}
run: |
bash start_scan.sh \
-a "$ACCESS_TOKEN" \
-r "$REPO_NAME" \
-c "$COMMIT_ID" \
-b "$BRANCH" \
-s github \
-i "$INCLUDE_PATHS" \
-e "$EXCLUDE_PATHS" \
-t "$SCAN_TIMEOUT" \
--scanners "$SCANNERS"