Add sourcery workflow #1
Workflow file for this run
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: Sourcery Code Quality | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
security-events: write | |
jobs: | |
sourcery: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install Sourcery | |
run: pip install sourcery-cli | |
- name: Login to Sourcery | |
env: | |
SOURCERY_TOKEN: ${{ secrets.SOURCERY_TOKEN }} | |
run: sourcery login --token $SOURCERY_TOKEN | |
- name: Run Sourcery Analysis | |
env: | |
SOURCERY_TOKEN: ${{ secrets.SOURCERY_TOKEN }} | |
run: | | |
sourcery review . --sarif --output results-sourcery.sarif | |
- name: Upload Sourcery results as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sourcery-results | |
path: results-sourcery.sarif | |
retention-days: 5 | |
- name: Upload SARIF to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: results-sourcery.sarif | |
category: sourcery |