create dir #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bandit Scan and Deploy to GitHub Pages | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
scan-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install Bandit | |
run: pip install bandit | |
- name: Create report directory | |
run: mkdir -p bandit-security-report | |
- name: Run Bandit and generate report | |
run: | | |
bandit -r src/ -f json -o bandit-security-report/bandit-report.json | |
python json_to_html.py bandit-security-report/bandit-report.json > bandit-security-report/index.html | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./bandit-security-report | |
commit_message: 'Deploy Bandit report to GitHub Pages' |