name: Security Audit

on:
  schedule:
    - cron: '0 0 * * 0'  # Run every Sunday at midnight
  push:
    paths: 
      - '**/Cargo.toml'
      - '**/Cargo.lock'
  workflow_dispatch:

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        
      - name: Install cargo-audit
        run: cargo install cargo-audit
        
      - name: Run cargo-audit
        run: cargo audit
