-
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.
- Loading branch information
1 parent
8e2d36c
commit 1b58fd6
Showing
1 changed file
with
25 additions
and
7 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,16 +1,34 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
branches: | ||
- main | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Get changed files | ||
uses: tj-actions/changed-files@v44 | ||
id: changed-files | ||
|
||
- name: List changed files | ||
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' | ||
|
||
- name: Local pre-commit | ||
uses: pre-commit/[email protected] | ||
with: | ||
extra_args: flake8 --all-files | ||
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }} | ||
|