name: cargo deny (licenses, 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 licenses sources

    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
        with:
          persist-credentials: false
      - uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1
        with:
          command: check ${{ matrix.checks }}
