cloudcheck 10.0.0

CloudCheck is a simple Rust tool to check whether an IP address or hostname belongs to a cloud provider.
name: Daily Signature Update

on:
  schedule:
    # Run daily at 6:00 UTC
    - cron: '0 6 * * *'
  workflow_dispatch:  # Allow manual trigger

# Prevent concurrent runs from racing to commit/merge
# cancel-in-progress: false means new runs wait instead of canceling in-progress ones
concurrency:
  group: daily-update
  cancel-in-progress: false

jobs:
  update:
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
    - name: Checkout stable branch
      uses: actions/checkout@v6
      with:
        ref: stable

    - name: Set up Python
      uses: actions/setup-python@v6
      with:
        python-version: "3.12"

    - name: Set up uv
      uses: astral-sh/setup-uv@v7

    - name: Install dependencies
      run: uv sync

    - name: Update signatures
      env:
        BBOT_IO_API_KEY: ${{ secrets.BBOT_IO_API_KEY }}
      run: uv run python -m cloudcheck_update.cli

    - name: Update README table
      run: uv run python scripts/update_readme_table.py

    - name: Check for changes
      id: changes
      run: |
        if git diff --quiet; then
          echo "has_changes=false" >> $GITHUB_OUTPUT
        else
          echo "has_changes=true" >> $GITHUB_OUTPUT
        fi

    - name: Commit and push to stable
      if: steps.changes.outputs.has_changes == 'true'
      run: |
        git config user.name "github-actions[bot]"
        git config user.email "github-actions[bot]@users.noreply.github.com"
        git add cloud_providers_v3.json README.md
        git commit -m "chore: daily signature update $(date -u +%Y-%m-%d)"
        git push origin HEAD:stable