Skip to content

Commit 5c2a6ea

Browse files
committed
fix: introduce uv-lock in ci.yml
1 parent 83eee3f commit 5c2a6ea

File tree

2 files changed

+17
-46
lines changed

2 files changed

+17
-46
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ on:
99
branches:
1010
- master
1111

12-
workflow_run: # chain from the uv-lock workflow
13-
workflows: ["uv.lock on Dependabot PRs"]
14-
types: [completed]
12+
permissions:
13+
contents: write
14+
pull-requests: write
1515

1616
jobs:
1717
build:
18-
# Only run if not a Dependabot PR, or once uv-lock has completed successfully
19-
if: |
20-
github.event_name == 'workflow_run' ||
21-
github.actor != 'dependabot[bot]'
2218
runs-on: ubuntu-latest
2319
strategy:
2420
matrix:
@@ -30,6 +26,20 @@ jobs:
3026
uses: astral-sh/setup-uv@v6
3127
with:
3228
python-version: ${{ matrix.python }}
29+
# refresh lock only for Dependabot PRs
30+
- name: Refresh uv.lock (Dependabot only)
31+
if: |
32+
github.event_name == 'pull_request' &&
33+
github.actor == 'dependabot[bot]'
34+
run: |
35+
uv lock
36+
if ! git diff --quiet -- uv.lock; then
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
git add uv.lock
40+
git commit -m "chore: refresh uv.lock"
41+
git push || echo "push skipped (no perms)"
42+
fi
3343
- name: Install dependencies
3444
run: |
3545
uv sync --locked --only-dev

.github/workflows/dependabot-uv-lock.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)