Skip to content

Commit

Permalink
ci(pre-commit-action): updated to simplified version provided by GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
tomassebestik committed Jul 12, 2024
1 parent 38b8d9c commit b887ab5
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
name: Pre-commit hooks CI
name: Check pre-commit

on:
pull_request:
types: [opened, edited, reopened, synchronize]
push:
branches: [ master ]

jobs:
pre-commit:
check-pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit on changed files
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.base_ref }}
git diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD ${{ github.base_ref }}) | xargs pre-commit run --files
env:
SKIP: "conventional-precommit-linter,eslint"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
env:
SKIP: "pip-compile,conventional-precommit-linter,eslint"

0 comments on commit b887ab5

Please sign in to comment.