-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (43 loc) · 1.47 KB
/
pre-commit-auto-update.yml
File metadata and controls
55 lines (43 loc) · 1.47 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
45
46
47
48
49
50
51
52
53
54
55
name: pre-commit autoupdate
on:
schedule:
- cron: "0 3 * * 1" # weekly, Monday 03:00 UTC
workflow_dispatch:
jobs:
autoupdate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install pre-commit
run: pip install --upgrade pre-commit
- name: Run autoupdate
id: autoupdate
run: |
set -e
pre-commit autoupdate
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .pre-commit-config.yaml || true
if git diff --cached --quiet; then
echo "changes=false" >> $GITHUB_OUTPUT
else
git commit -m "chore: autoupdate pre-commit hooks" || true
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.autoupdate.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: autoupdate pre-commit hooks"
title: "chore: autoupdate pre-commit hooks"
body: |
Automated update of pre-commit hook versions.
Please review hook changelogs before merging.
branch: pre-commit-autoupdate
delete-branch: true
labels: chore,dependencies