-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.27 KB
/
pre-commit-update.yml
File metadata and controls
43 lines (37 loc) · 1.27 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
38
39
40
41
42
43
name: Update .pre-commit-config.yaml
on:
schedule:
- cron: '0 3 * * 1' # Every Monday at 03:00 UTC
workflow_dispatch:
jobs:
update-pre-commit-config:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pre-commit
run: pipx install pre-commit
- name: Update .pre-commit-config.yaml
run: pre-commit autoupdate --freeze
- name: Apply pre-commit
run: |
n=0
while [[ $n -lt 5 ]] && ! pre-commit run --all; do
((n++))
done
exit $?
- name: Create Pull Request
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
with:
commit-message: "chore(deps): Update .pre-commit-config.yaml"
title: "chore(deps): Update .pre-commit-config.yaml"
body: "Automated update of .pre-commit-config.yaml via scheduled workflow."
branch: "update/pre-commit-config-yaml"
base: ${{ github.ref_name }}
labels: "update"
reviewers: "linuxdaemon"
assignees: "linuxdaemon"
sign-commits: true