-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.08 KB
/
pre-commit.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
#Precommit-Action
name: Pre-commit Auto Fix
on:
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.12"
- name: Install dependencies
if: ${{ always() }}
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit
if: ${{ always() }}
run: pre-commit run --all-files
- name: Create Pull Request
if: ${{ always() }}
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "🎨 Auto Code Fix (Pre-commit)"
branch: auto/pre-commit-fix
title: "🎨 Auto Code Fix (Pre-commit)"
body: "This pull request contains auto code fixes from pre-commit."
labels: |
auto-fix
pre-commit