name: Security Audit (advisories, sources)
permissions:
  contents: read

on:
  push:
    # Check immediately if dependencies are altered
    paths:
      - "**/Cargo.toml"
    # Check also at midnight each day
  schedule:
    - cron: "0 0 * * *"

jobs:
  cargo-deny:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        checks:
          - advisories
          - bans sources

    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
        with:
          persist-credentials: false

      - uses: EmbarkStudios/cargo-deny-action@30f817c6f72275c6d54dc744fbca09ebc958599f
        with:
          command: check ${{ matrix.checks }}
