-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (31 loc) · 1.04 KB
/
pre-commit-autoupdate.yml
File metadata and controls
37 lines (31 loc) · 1.04 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
name: Update Pre-commit Hooks
on:
schedule:
- cron: '0 3 1 * *' # monthly
workflow_dispatch:
jobs:
autoupdate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install pre-commit
run: python -m pip install --upgrade pip pre-commit
- name: Run pre-commit autoupdate
run: pre-commit autoupdate
- name: Create Pull Request if changes
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update pre-commit hooks"
branch: "pre-commit-autoupdate"
title: "Update pre-commit hooks"
body: "This PR updates the pre-commit hooks to their latest versions."
base: "master" # change to your default branch
path: ".pre-commit-config.yaml"
# Only create a PR if there are changes
update-branch: true