-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (42 loc) · 1.59 KB
/
Copy pathbot.yaml
File metadata and controls
44 lines (42 loc) · 1.59 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
40
41
42
43
44
name: bot
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
pull_request:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
uv-lock:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
- run: uv lock --upgrade
- uses: autofix-ci/action@v1.3.2
if: ${{ github.event_name == 'pull_request' }}
- name: Push lock file changes
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
if [ -n "$(git status --porcelain)" ]; then
git add uv.lock
git commit -m "Upgrade uv.lock"
git push origin main
fi
auto-merge:
needs: uv-lock
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
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.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 }}