-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
1 changed file
with
29 additions
and
5 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 |
---|---|---|
|
@@ -16,13 +16,37 @@ permissions: | |
contents: write | ||
|
||
jobs: | ||
formatting: | ||
format-fix: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
# Run reorder-python-imports + black formatter | ||
- name: Black Code Formatter | ||
uses: tdeboissiere/python-format-action@master | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install formatting tools | ||
run: | | ||
pip install black flake8 isort | ||
- name: Run and fix formatting | ||
run: | | ||
black . | ||
isort . | ||
flake8 . | ||
# 提交修复的代码 | ||
- name: Commit and push fixes | ||
if: success() || failure() | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git add . | ||
git commit -m "Fix formatting issues" || echo "No changes to commit" | ||
git push | ||
update-hosts: | ||
runs-on: ubuntu-latest | ||
|