Skip to content

Commit 07797d6

Browse files
committed
use PR to upgrade uv-lock
1 parent 76437c5 commit 07797d6

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

.github/workflows/bot.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,36 @@ on: # yamllint disable-line rule:truthy
88
- cron: '0 3 * * *'
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
1115
jobs:
1216
uv-lock:
13-
permissions:
14-
contents: write
1517
runs-on: ubuntu-latest
1618
steps:
1719
- uses: actions/checkout@v4
1820
- uses: astral-sh/setup-uv@v6
1921
- run: uv lock --upgrade
2022
- uses: autofix-ci/action@v1.3.2
2123
if: ${{ github.event_name == 'pull_request' }}
22-
- name: Push lock file changes
24+
- uses: peter-evans/create-pull-request@v7
25+
with:
26+
commit-message: "chore: upgrade uv.lock"
27+
title: "chore: upgrade uv.lock"
28+
body: This PR updates the uv.lock file with the latest dependency versions.
29+
branch: update-uv-lock
30+
delete-branch: true
2331
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
24-
run: |
25-
git config user.name 'github-actions[bot]'
26-
git config user.email 'github-actions[bot]@users.noreply.github.com'
27-
if [ -n "$(git status --porcelain)" ]; then
28-
git add uv.lock
29-
git commit -m "Upgrade uv.lock"
30-
git push origin main
31-
fi
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 }}
3238

3339
auto-merge:
3440
needs: uv-lock
35-
permissions:
36-
contents: write
37-
pull-requests: write
3841
runs-on: ubuntu-latest
3942
if: ${{ github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]') }}
4043
steps:

0 commit comments

Comments
 (0)