on:
  workflow_call:

permissions: {}

jobs:
  lock:
    timeout-minutes: 10
    runs-on: ubuntu-slim
    name: "uv lockfiles"
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false
      - name: "Install uv"
        uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
        with:
          version: "0.11.16"
      - name: "Check project lockfile"
        run: uv lock --check
      - name: "Check script lockfiles"
        run: |
          while IFS= read -r lockfile; do
            uv lock --script "${lockfile%.lock}" --check
          done < <(git ls-files '*.py.lock')
