threatflux-cache 0.1.8

A flexible async cache library for Rust with pluggable backends and serialization
Documentation
name: Dependency Update

on:
  schedule:
    # Run every Monday at 9 AM UTC
    - cron: '0 9 * * 1'
  workflow_dispatch:

permissions:
  contents: write
  pull-requests: write

jobs:
  update-dependencies:
    name: Update Dependencies
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v4
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

    - name: Install Rust toolchain
      uses: dtolnay/rust-toolchain@stable

    - name: Cache cargo
      uses: actions/cache@v4
      with:
        path: |
          ~/.cargo/registry/index/
          ~/.cargo/registry/cache/
          ~/.cargo/git/db/
        key: ${{ runner.os }}-cargo-update-${{ hashFiles('**/Cargo.lock') }}

    - name: Install cargo-edit
      run: cargo install cargo-edit

    - name: Update dependencies
      run: |
        echo "๐Ÿ“ฆ Updating Cargo dependencies..."
        cargo update
        
        # Check for outdated dependencies
        echo "๐Ÿ” Checking for outdated dependencies..."
        cargo outdated || true

    - name: Check if dependencies changed
      id: changes
      run: |
        if git diff --quiet Cargo.lock; then
          echo "changed=false" >> $GITHUB_OUTPUT
          echo "โ„น๏ธ  No dependency updates available"
        else
          echo "changed=true" >> $GITHUB_OUTPUT
          echo "โœ… Dependencies updated"
        fi

    - name: Run tests after update
      if: steps.changes.outputs.changed == 'true'
      run: |
        echo "๐Ÿงช Running tests with updated dependencies..."
        cargo test --all-features

    - name: Create Pull Request
      if: steps.changes.outputs.changed == 'true'
      uses: peter-evans/create-pull-request@v6
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        commit-message: "chore: update Cargo dependencies"
        title: "chore: Update Cargo dependencies"
        body: |
          ## Dependency Updates
          
          This PR updates the project dependencies to their latest compatible versions.
          
          ### Changes
          - Updated `Cargo.lock` with latest dependency versions
          - All tests pass with updated dependencies
          
          ### Verification
          - [x] Tests pass
          - [x] Build succeeds
          - [x] No breaking changes introduced
          
          This PR was automatically created by the dependency update workflow.
        branch: update-dependencies
        delete-branch: true
        labels: |
          dependencies
          automated-pr