Bin
2025-12-16 7423b0c6e1959f30a7e8e453e953310f32ce13c6
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
41
42
43
44
45
46
47
48
49
50
51
52
name: "Bandit"
 
on:
  workflow_call:
    inputs:
      head_sha:
        required: true
        type: string
 
env:
  BANDIT_VERSION: 1.7.8
  PROJECT_PATH: 'label_studio/'
  REPORT_PATH: 'bandit_results/bandit_security_report.txt'
  ACTIONS_STEP_DEBUG: '${{ secrets.ACTIONS_STEP_DEBUG }}'
 
jobs:
  bandit:
    name: "Bandit"
    timeout-minutes: 5
    runs-on: ubuntu-latest
    steps:
      - uses: hmarr/debug-action@v3.0.0
 
      - name: Checkout
        uses: actions/checkout@v6
        with:
          ref: ${{ inputs.head_sha }}
 
      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: '3.13'
 
      - name: Install Bandit
        run: |
          pip install bandit==$BANDIT_VERSION
 
      - name: Run Bandit
        run: |
          mkdir -p bandit_results
          touch ${{ env.REPORT_PATH }}
          bandit -r $PROJECT_PATH -o ${{ env.REPORT_PATH }} -f 'txt' -ll
 
      - name: Print scan results
        if: always()
        run: cat ${{ env.REPORT_PATH }}
 
      - uses: actions/upload-artifact@v6
        if: always()
        with:
          name: Security check results
          path: ${{ env.REPORT_PATH }}