Skip to content

Commit

Permalink
Switch to home-brewed pre-commit CI action
Browse files Browse the repository at this point in the history
  • Loading branch information
stdedos committed Aug 1, 2024
1 parent f01752d commit cf5b316
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: pre-commit

on:
schedule:
- cron: '0 8 * * *'
# Triggers the workflow on push or pull request events
push:
branches:
- main
- feat/*
pull_request:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: write

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x

- uses: pre-commit/[email protected]

- name: Commit changes
if: ${{ !cancelled() && failure() }}
shell: bash
run: |
git config --local user.name "pre-commit-ci[bot]"
git config --local user.email "66853113+pre-commit-ci[bot]@users.noreply.github.com"
git commit -m "[pre-commit.ci] auto-fixes from pre-commit hooks" -a
git push origin HEAD:${{ github.head_ref || github.ref_name }}
21 changes: 15 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
ci:
autofix_commit_msg: '[pre-commit.ci] auto-fixes from pre-commit hooks'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=lf
- id: trailing-whitespace
- id: check-added-large-files
args:
- --maxkb=10000
- id: check-merge-conflict
- id: mixed-line-ending
- id: detect-private-key
- id: end-of-file-fixer
exclude: '^(Media/.*)'
- id: forbid-new-submodules
- id: trailing-whitespace
exclude: '^(Media/.*)'

0 comments on commit cf5b316

Please sign in to comment.