-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (42 loc) · 1.34 KB
/
pre-commit-autoupdate.yml
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: pre-commit autoupdate
on:
workflow_dispatch:
schedule:
- cron: "0 6 4 * *"
defaults:
run:
shell:
bash -el {0}
jobs:
check_update:
name: Check if newer version exists
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
# We need to checkout with SSH here to have actions run on the PR.
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194
with:
environment-name: pre-commit
create-args: >-
pre-commit
mamba
- name: Update pre-commit hooks and run
id: versions
env:
PRE_COMMIT_USE_MAMBA: 1
run: |
pre-commit autoupdate
pre-commit run -a || true
- uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
with:
commit-message: "Auto-update pre-commit hooks"
title: "Auto-update pre-commit hooks"
body: |
New versions of the used pre-commit hooks were detected.
This PR updates them to the latest and already ran `pre-commit run -a` for you to fix any changes in formatting.
branch: pre-commit-autoupdate
delete-branch: true