name: audit
on:
  schedule:
    - cron: '10 01 * * *' # Every day at 01:10 UTC
  push:
    branches:
      - 2.x
    paths:
      - "**/Cargo.lock"
      - "**/Cargo.toml"
  pull_request:
    branches:
      - 2.x
    paths:
      - "**/Cargo.lock"
      - "**/Cargo.toml"

jobs:
  audit:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - uses: actions-rs/audit-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
