Skip to content

Commit e7301fe

Browse files
committed
Update actions and pre-commit checks to match other repos
This groups Dpendabot updates and tiggers `prek auto-update` when Dependabot uppdates GitHub actions.
1 parent 1466916 commit e7301fe

3 files changed

Lines changed: 52 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,19 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "monthly"
8+
groups:
9+
github-actions:
10+
patterns:
11+
- "*"
12+
13+
- package-ecosystem: "cargo"
14+
directory: "/"
15+
schedule:
16+
interval: "monthly"
17+
# Security updates only:
18+
open-pull-requests-limit: 0
19+
groups:
20+
cargo-dependencies:
21+
applies-to: security-updates
22+
patterns:
23+
- "*"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Dependabot `prek auto-update`
2+
3+
on:
4+
push:
5+
branches:
6+
- "dependabot/github_actions/**"
7+
8+
jobs:
9+
prek-auto-update:
10+
# Only run on dependabot PRs
11+
if: github.actor == 'dependabot[bot]'
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
ref: ${{ github.head_ref }}
19+
token: ${{ secrets.PUSH_TOKEN }}
20+
- uses: taiki-e/install-action@v2
21+
with:
22+
tool: prek
23+
- run: prek auto-update
24+
25+
- name: Commit changes
26+
run: |
27+
git config user.name "github-actions[bot]"
28+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
29+
30+
if [[ -n $(git status --porcelain) ]]; then
31+
git add -A
32+
git commit -m $'`prek auto-update`\n\n[dependabot skip]'
33+
git push
34+
fi

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ repos:
1717
- id: detect-private-key
1818
- id: mixed-line-ending
1919
args: ["--fix=no"]
20-
exclude: "^target/"
20+
exclude: "target/"
2121
- id: no-commit-to-branch
2222
- repo: https://github.com/crate-ci/typos
2323
rev: v1.41.0
2424
hooks:
2525
- id: typos
2626
args: []
27-
exclude: "^target/"
27+
exclude: "target/"
2828
- repo: local
2929
hooks:
3030
- id: cargo clippy

0 commit comments

Comments
 (0)