Skip to content

Commit d8e72bb

Browse files
Improve upgrade of uv.lock through GitHub app (#109)
* chore: upgrade uv.lock * revert workflow attempt * remove upgrade * better * better name * Revert "chore: upgrade uv.lock" This reverts commit e7d49b8. * fix --------- Co-authored-by: mscheltienne <73893616+mscheltienne@users.noreply.github.com> Co-authored-by: Mathieu Scheltienne <mathieu.scheltienne@dandelion.science>
1 parent 07797d6 commit d8e72bb

2 files changed

Lines changed: 10 additions & 16 deletions

File tree

.github/workflows/bot.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: autofix.ci
1+
name: bot
22
concurrency:
33
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
44
cancel-in-progress: true
@@ -14,32 +14,30 @@ permissions:
1414

1515
jobs:
1616
uv-lock:
17+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
1718
runs-on: ubuntu-latest
19+
name: uv lock --upgrade
1820
steps:
21+
- uses: actions/create-github-app-token@v2
22+
id: app-token
23+
with:
24+
app-id: ${{ secrets.UV_LOCK_UPGRADER_APP_ID }}
25+
private-key: ${{ secrets.UV_LOCK_UPGRADER_APP_PRIVATE_KEY }}
1926
- uses: actions/checkout@v4
2027
- uses: astral-sh/setup-uv@v6
2128
- run: uv lock --upgrade
22-
- uses: autofix-ci/action@v1.3.2
23-
if: ${{ github.event_name == 'pull_request' }}
2429
- uses: peter-evans/create-pull-request@v7
2530
with:
31+
token: ${{ steps.app-token.outputs.token }}
2632
commit-message: "chore: upgrade uv.lock"
2733
title: "chore: upgrade uv.lock"
2834
body: This PR updates the uv.lock file with the latest dependency versions.
2935
branch: update-uv-lock
3036
delete-branch: true
31-
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
32-
id: pr
33-
- name: Enable auto-merge for the PR
34-
if: ${{ steps.pr.outputs.pull-request-number }}
35-
run: gh pr merge --auto --squash "${{ steps.pr.outputs.pull-request-number }}"
36-
env:
37-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3837

3938
auto-merge:
40-
needs: uv-lock
39+
if: ${{ github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' || github.event.pull_request.user.login == 'github-actions[bot]') }}
4140
runs-on: ubuntu-latest
42-
if: ${{ github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]') }}
4341
steps:
4442
- name: Enable auto-merge for bot PRs
4543
run: gh pr merge --auto --squash "$PR_URL"

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
ci:
2-
skip: [uv-lock]
3-
41
repos:
52
- repo: https://github.com/astral-sh/uv-pre-commit
63
rev: 0.7.12
74
hooks:
85
- id: uv-lock
9-
args: [--upgrade]
106

117
- repo: https://github.com/astral-sh/ruff-pre-commit
128
rev: v0.11.13

0 commit comments

Comments
 (0)