forked from cc-api/container-integrity-measurement-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.02 KB
/
pr-pylint.yaml
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
name: Python Code Scan
on:
push:
branches:
- main
paths:
- 'sdk/python3/cima/**.py'
pull_request:
paths:
- 'sdk/python3/cima/**.py'
workflow_dispatch:
jobs:
scan_python:
runs-on: ubuntu-22.04
steps:
- name: Checkout PR
uses: actions/checkout@v3
- name: Setup Python action
uses: actions/setup-python@v4
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pylint
python3 -m pip install -r ./sdk/python3/requirements.txt
python3 -m pip install -e ./sdk/python3/
- name: Analyze python code
run: |
set -ex
export PYTHONPATH=$PWD/cima:$PYTHONPATH
python_files=$(find . -path ./sdk/python3/tests -prune -o -name "*.py" -print)
if [[ -n "$python_files" ]]; then
echo "$python_files" | xargs -n 1 python3 -m pylint --rcfile=.github/pylintrc
else
echo "No Python files found."
fi