-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (36 loc) · 1.3 KB
/
bot.yaml
File metadata and controls
39 lines (36 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: bot
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request
permissions:
contents: write
pull-requests: write
jobs:
uv-lock:
runs-on: ubuntu-latest
if: github.repository == 'mscheltienne/template-python' # prevent running on forks
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: astral-sh/setup-uv@v6
- run: uv lock --upgrade
- name: Commit changes
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git add uv.lock
git diff --staged --quiet || git commit -m "Update uv.lock"
git push
auto-merge:
needs: uv-lock
runs-on: ubuntu-latest
if: (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]') && github.repository == 'mscheltienne/template-python'
steps:
- name: Enable auto-merge for bot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}