on:
  workflow_call:

permissions: {}

jobs:
  lock:
    timeout-minutes: 10
    runs-on: ubuntu-slim
    name: "uv lockfiles"
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      - name: "Install uv"
        uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
        with:
          version: "0.11.29"
      - name: "Check project lockfile"
        run: uv lock --check
      - name: "Check script lockfiles"
        env:
          UV_PREVIEW_FEATURES: workspace-list-scripts
        run: |
          set -e -o pipefail
          uv workspace list --scripts |
          while IFS= read -r script; do
            uv lock --script "$script" --check
          done
