Fix continue-on-error placement in Safety CLI workflow step (#45) #118
This file contains hidden or 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: Security Scan | |
| on: | |
| schedule: | |
| # Run weekly on Sundays at 2 AM UTC | |
| - cron: '0 2 * * 0' | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| codeql: | |
| name: CodeQL Analysis | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: [ 'python' ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: ${{ matrix.language }} | |
| - name: Autobuild | |
| uses: github/codeql-action/autobuild@v4 | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 | |
| with: | |
| category: "/language:${{matrix.language}}" | |
| secrets-scan: | |
| name: Secrets Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run TruffleHog OSS | |
| uses: trufflesecurity/trufflehog@main | |
| with: | |
| path: ./ | |
| base: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || 'HEAD~1' }} | |
| head: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'HEAD' }} | |
| extra_args: --debug --only-verified | |
| crypto-analysis: | |
| name: Cryptographic Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install analysis tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install bandit[toml] semgrep | |
| - name: Run bandit for crypto issues | |
| run: | | |
| bandit -r git_safe/ -f json -o bandit-crypto-report.json -ll -i || true | |
| bandit -r git_safe/ -ll -i | |
| - name: Run semgrep crypto rules | |
| run: | | |
| semgrep --config=p/python --config=p/security-audit --config=p/secrets git_safe/ --json --output=semgrep-report.json || true | |
| semgrep --config=p/python --config=p/security-audit --config=p/secrets git_safe/ | |
| - name: Upload crypto analysis reports | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: crypto-analysis-reports | |
| path: | | |
| bandit-crypto-report.json | |
| semgrep-report.json |