Skip to content

Commit fe600b4

Browse files
committed
Add pre-commit auto-update workflow
1 parent 196d2a3 commit fe600b4

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)