Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bandit scan to github workflow #1834

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Bandit is a tool designed to find common security issues in Python code
# this is a customized copy from https://github.com/PyCQA/bandit-action
# original author: '@PyCQA'
#
# Target for code check is src/moin, test modules are exclude in config file
# All alerts are logged in the GitHub UI on the Security tab, Code Scanning (choose your branch)

name: Bandit

on:
push:
branches:
- master
- test-github-action
pull_request:
branches:
- master

jobs:
bandit_check:

runs-on: ubuntu-latest
timeout-minutes: 3

steps:
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Bandit
shell: bash
run: pip install bandit[sarif]

- name: Checkout repository
uses: actions/checkout@v4

- name: Run Bandit
shell: bash
run: bandit -c pyproject.toml -r src/moin -f sarif -o results.sarif || true

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif