Skip to content

Commit 1c87d46

Browse files
Optimize lockfile check: only regenerate on failure
- Check lockfile first with uv lock --check (fast path) - Only regenerate lockfile if check fails (to show diff) - Provides helpful error message showing exact changes needed - More efficient while still being informative Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
1 parent 6160047 commit 1c87d46

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/code_quality.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
run: |
2828
uv sync --frozen --extra dev
2929
30-
- name: Update lockfile
31-
run: uv lock
32-
3330
- name: Check lockfile freshness
3431
run: |
35-
if ! git diff --quiet uv.lock; then
32+
if ! uv lock --check; then
3633
echo "::error::uv.lock is out of sync with pyproject.toml"
37-
echo "Please run 'uv lock' locally and commit the changes"
34+
echo "Running 'uv lock' to show what needs to be updated..."
35+
uv lock
36+
echo ""
37+
echo "Please run 'uv lock' locally and commit the changes:"
3838
git --no-pager diff uv.lock
3939
exit 1
4040
fi

0 commit comments

Comments
 (0)