Skip to content

Compliance Checks #1585

Compliance Checks

Compliance Checks #1585

Workflow file for this run

name: Compliance Checks
on:
push:
paths:
- 'pyproject.toml'
schedule:
- cron: '0 0 * * *' # every day at midnight
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_ALERT_CHANNEL: "#dc-alerts"
jobs:
check-license-compliance:
name: Check license compliance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
python-version: "3.10"
- name: Install prod dependencies
run: |
uv sync
uv export --no-dev --no-hashes > requirements.txt
- name: Create file with full dependency list
run: |
uv pip freeze > requirements-full.txt
- name: Send license report to Fossa
# This will collect all necessary information (mostly used dependencies) and send it to the Fossa API
uses: fossas/fossa-action@ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 # Use a specific version if locking is preferred
with:
api-key: ${{ secrets.FOSSA_LICENSE_SCAN_TOKEN }}
- name: Check license compliance
# This will poll the Fossa API until they have processed the information which we've sent in the previous step
# and fail if Fossa found an issue with the licences of our dependencies.
uses: fossas/fossa-action@ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 # Use a specific version if locking is preferred
with:
api-key: ${{ secrets.FOSSA_LICENSE_SCAN_TOKEN }}
run-tests: true
- name: Send Slack notification if license check failed
uses: act10ns/slack@d96404edccc6d6467fc7f8134a420c851b1e9054
if: failure() && github.ref == 'refs/heads/main'
with:
status: ${{ job.status }}
channel: ${{ env.SLACK_ALERT_CHANNEL }}