Skip to content

Commit 1725f64

Browse files
committed
Adding pre-commit on check-in.
1 parent 4212a5e commit 1725f64

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: pre-commit
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.x"
17+
- uses: pre-commit/[email protected]
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
20+
cancel-in-progress: true
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Pre-commit auto-update
3+
4+
on:
5+
# every Monday at midnight
6+
schedule:
7+
- cron: "0 0 * * 1"
8+
# on demand
9+
workflow_dispatch:
10+
11+
jobs:
12+
auto-update:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.x"
22+
- uses: browniebroke/[email protected]
23+
- uses: peter-evans/create-pull-request@v5
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
branch: update/pre-commit-hooks
27+
title: Update pre-commit hooks
28+
commit-message: "chore: update pre-commit hooks"
29+
body: Update versions of pre-commit hooks to latest version.

0 commit comments

Comments
 (0)