-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(pre-commit-action): updated to simplified version provided by GitHub
- Loading branch information
1 parent
38b8d9c
commit b887ab5
Showing
1 changed file
with
10 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |