Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
81 lines (74 loc) · 2.48 KB
/
Copy pathaction.yml
File metadata and controls
81 lines (74 loc) · 2.48 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
# action.yml
name: "Plexicus Runner Action"
description: 'Plexicus code analyzer for COVULOR cloud service'
author: 'Plexicus'
branding:
icon: 'shield'
color: 'blue'
inputs:
plexalyzer-token:
description: 'Authentication token for COVULOR cloud service'
required: true
default-owner:
description: 'Default repository owner'
required: false
repo-id:
description: 'Repository ID in COVULOR service'
required: true
repo-name:
description: 'Name of the repository'
required: true
branch:
description: 'Branch name for the pull request'
required: true
url:
description: 'Clone URL of the repository'
required: true
pr-id:
description: 'ID of the PR to be analyzed'
required: true
files-path:
description: 'Path to file containing files list for scanning'
required: false
workspace-path:
description: 'Path to the repository workspace'
required: true
runs:
using: 'composite'
steps:
- name: Prepare Files List in Required Format
id: prepare-files
if: ${{ inputs.files-path }}
shell: bash
run: |
jq -r '.[]' "${{ inputs.files-path }}" > files_to_analyze.txt
echo "files_to_analyze=$(pwd)/files_to_analyze.txt" >> $GITHUB_ENV
- name: Run PLEXALYZER Docker Analysis
shell: bash
env:
PLEXALYZER_TOKEN: ${{ inputs.plexalyzer-token }}
MESSAGE_URL: 'https://api.app.plexicus.ai/plexalyzer-message-receipts'
run: |
# Construct the Docker command
docker_command="docker run --rm \
-e PLEXALYZER_TOKEN=\"$PLEXALYZER_TOKEN\" \
-e MESSAGE_URL=\"$MESSAGE_URL\" \
-v \"${{ inputs.workspace-path }}:/mounted_volumes\""
if [ -n "${files_to_analyze}" ]; then
docker_command+=" -v \"$files_to_analyze:/app/files_to_analyze.txt\""
fi
docker_command+=" plexicus/plexalyzer-code:latest \
/venvs/plexicus-fastapi/bin/python /app/analyze.py \
--repository_id \"${{ inputs.repo-id }}\" \
--name \"${{ inputs.repo-name }}\" \
--branch \"${{ inputs.branch }}\" \
--url \"${{ inputs.url }}\" \
--pr-id \"${{ inputs.pr-id }}\" \
--no-progress-bar"
if [ ${{ inputs.default-owner }} ]; then
docker_command+=" --owner \"${{ inputs.default-owner }}\""
fi
if [ -n "${files_to_analyze}" ]; then
docker_command+=" --files \"/app/files_to_analyze.txt\""
fi
eval $docker_command