Skip to content

Commit d4703c2

Browse files
committed
add pre-commit autoupdate workflow
1 parent de0378d commit d4703c2

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Autoupdate pre-commit
2+
3+
on:
4+
workflow_dispatch:
5+
# To guarantee Maintained check is occasionally updated. See
6+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
7+
schedule:
8+
- cron: '28 2 * * 6' # Saturday at 02:28 UTC
9+
10+
permissions: read-all
11+
12+
jobs:
13+
autoupdate:
14+
name: Autoupdate
15+
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
19+
permissions:
20+
# Needed to create a PR with autoupdate changes
21+
contents: write
22+
pull-requests: write
23+
24+
steps:
25+
- name: Checkout mkl_random repo
26+
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
27+
28+
- name: Set up python
29+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v5.6.0
30+
with:
31+
python-version: '3.13'
32+
33+
- name: Install pre-commit
34+
run: pip install pre-commit
35+
36+
- name: Run pre-commit autoupdate
37+
run: pre-commit autoupdate
38+
39+
- name: Create a PR with autoupdate changes
40+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 #v8.1.0
41+
with:
42+
commit-message: 'chore: update pre-commit hooks'
43+
add-paths: .pre-commit-config.yaml
44+
branch: 'bot/pre-commit-autoupdate'
45+
delete-branch: true
46+
title: Weekly pre-commit autoupdate
47+
body: |
48+
This PR updates the `.pre-commit-config.yaml` using `pre-commit autoupdate`.
49+
labels: autoupdate

0 commit comments

Comments
 (0)