Skip to content

Commit a0f3c51

Browse files
authored
Merge pull request #1480 from lukaszstolarczuk/update-bandit-workflow
[CI] Enable more scans with Bandit
2 parents 03b7148 + 8d07a4a commit a0f3c51

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.github/workflows/bandit.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
linux:
14+
bandit:
1515
name: Bandit
16-
runs-on: ubuntu-latest
17-
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest]
19+
runs-on: ${{matrix.os}}
20+
1821
steps:
1922
- name: Clone the git repo
2023
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2124

2225
- name: Install pip packages
2326
run: pip install -r third_party/requirements.txt
2427

25-
# Scan is run only for the 'tools' folder.
28+
# Scan all files, except for dev. scripts
2629
- name: Run Bandit
27-
run: |
28-
bandit -r tools
30+
run: bandit -r . -x ./scripts/

test/conformance/cts_exe.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
parser.add_argument("--test_devices_count", type=str, help="Number of devices on which tests will be run")
2424
parser.add_argument("--test_platforms_count", type=str, help="Number of platforms on which tests will be run")
2525
args = parser.parse_args()
26-
27-
result = subprocess.Popen([args.test_command, '--gtest_brief=1', f'--devices_count={args.test_devices_count}',
26+
27+
result = subprocess.Popen([args.test_command, '--gtest_brief=1', # nosec B603
28+
f'--devices_count={args.test_devices_count}',
2829
f'--platforms_count={args.test_platforms_count}'],
29-
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) # nosec B603
30+
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
3031

3132
pat = re.compile(r'\[( )*FAILED( )*\]')
3233
output_list = []

0 commit comments

Comments
 (0)