-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update verify branch pre-commit hook, add workflow
- Loading branch information
Showing
2 changed files
with
47 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
on: | ||
pull_request: | ||
types: [labeled, opened, reopened, synchronize] | ||
push: | ||
branches: ["develop*"] | ||
|
||
jobs: | ||
run-precommit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest push changes | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
since_last_remote_commit: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Pre-commit | ||
run: pip install pre-commit | ||
|
||
- name: Run pre-commit on changed files | ||
run: | | ||
if [ -n "${{ steps.changed-files.outputs.all_changed_files }}" ]; then | ||
pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }} | ||
else | ||
echo "No files have changed, skipping pre-commit." | ||
fi |
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