Skip to content

Commit 6d290af

Browse files
committed
update pre-commit configs as well
Signed-off-by: John Seekins <[email protected]>
1 parent 6f29eac commit 6d290af

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,12 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "weekly"
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "monthly"
13+
open-pull-requests-limit: 1
14+
groups:
15+
actions:
16+
dependency-type: "production"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
name: Ensure Pre-commit services are updated (if possible)
3+
4+
on:
5+
workflow_dispatch: {}
6+
schedule:
7+
- cron: '0 0 1 * *' # Run on midnight on the first of the month
8+
9+
permissions:
10+
pull-requests: write
11+
contents: write
12+
13+
concurrency:
14+
group: precommit-updates
15+
cancel-in-progress: true
16+
17+
jobs:
18+
auto-update:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v5
22+
- id: file-check
23+
run: |
24+
files=$(find . -type f -name ".pre-commit-config.yaml" -print0 | xargs)
25+
if [[ -s "${files}" ]]; then
26+
echo "files_exist=true" >> "$GITHUB_OUTPUT"
27+
else
28+
echo "files_exist=false" >> "$GITHUB_OUTPUT"
29+
fi
30+
# selfhosted nodes have precommit installed by default
31+
- name: Run pre-commit autoupdate
32+
if: steps.file-check.outputs.files_exist == 'true'
33+
run: |
34+
sudo apt-get install -yqq python3-pip python3-wheel
35+
pip3 install -q --disable-pip-version-check pre-commit
36+
pre-commit autoupdate
37+
- name: Create Pull Request
38+
if: steps.file-check.outputs.files_exist == 'true'
39+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
40+
with:
41+
token: ${{ github.token }}
42+
branch: update/pre-commit-autoupdate
43+
title: Auto-update pre-commit hooks
44+
commit-message: ND - Auto-update pre-commit hooks
45+
body: |
46+
Update versions of tools in pre-commit
47+
configs to latest version
48+
labels: dependencies
49+
delete-branch: true
50+
sign-commits: true

0 commit comments

Comments
 (0)