Skip to content

Commit

Permalink
Add bandit workflow (#1884)
Browse files Browse the repository at this point in the history
  • Loading branch information
amontanez24 committed Apr 3, 2024
1 parent 27d1b25 commit 3c93c3f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/static_code_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Static Code Analysis

on:
release:
types: [published]
workflow_dispatch:

jobs:
code-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install bandit==1.7.7
- name: Save code analysis
run: python -m bandit -r . -x ./tests -f txt -o static_code_analysis.txt
- name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update static code analysis
title: Latest Code Analysis
body: "This is an auto-generated PR with the **latest** code analysis results."
branch: static-code-analysis
branch-suffix: short-commit-hash
base: main
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ namespaces = false
'*' = [
'* __pycache__',
'*.py[co]',
'static_code_analysis.txt',
]

[tool.setuptools.dynamic]
Expand Down

0 comments on commit 3c93c3f

Please sign in to comment.