-
Notifications
You must be signed in to change notification settings - Fork 14
53 lines (46 loc) · 1.94 KB
/
update_precommit_hooks.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
45
46
47
48
49
50
51
52
53
---
name: update precommit hooks
on:
# Uses the cron schedule for github actions
#
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events
#
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
schedule:
- cron: 0 0 1 1,4,7,10 * # every 3 months
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
update_precommit_hooks:
# only run on upstream repo
if: github.repository_owner == 'neuropower'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
allow-prereleases: false
- name: Install pre-commit
run: pip install pre-commit
- name: Update pre-commit hooks
run: pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: pre-commit hooks auto-update
base: master
token: ${{ secrets.GITHUB_TOKEN }}
delete-branch: true
title: '[BOT] update pre-commit hooks'
body: done via this [GitHub Action](https://github.com/${{ github.repository_owner }}/neurodesign/blob/master/.github/workflows/update_precommit_hooks.yml)