77 pull_request :
88 branches :
99 - ' **'
10+ workflow_dispatch :
1011
1112jobs :
1213 test :
1314 name : Run Tests
1415 runs-on : ubuntu-latest
1516 if : |
1617 github.event_name == 'push' ||
18+ github.event_name == 'workflow_dispatch' ||
1719 (
1820 github.event_name == 'pull_request' &&
1921 github.repository != github.event.pull_request.head.repo.full_name
4749 runs-on : ubuntu-latest
4850 if : |
4951 github.event_name == 'push' ||
52+ github.event_name == 'workflow_dispatch' ||
5053 (
5154 github.event_name == 'pull_request' &&
5255 github.repository != github.event.pull_request.head.repo.full_name
@@ -64,25 +67,25 @@ jobs:
6467 - name : Install tools
6568 run : |
6669 python -m pip install --upgrade pip
67- pip install "black[jupyter]==25.1.0" isort==6.0.1
70+ pip install -e ".[dev]"
6871
6972 - name : Run Black and Isort
7073 run : |
7174 if [[ "${{ github.event_name }}" == "push" && "${{ github.repository }}" == "${{ github.event.repository.full_name }}" ]]; then
7275 echo "Push event in same repo: Running black and isort with auto-format and commit"
7376 black .
7477 isort .
75- git config user.name "github-actions"
76- git config user.email "github-actions@ github.com"
78+ git config user.name "github-actions[bot] "
79+ git config user.email "41898282+ github-actions[bot]@users.noreply. github.com"
7780 if ! git diff --quiet; then
7881 git commit -am "style: auto-format with black and isort"
7982 git push
8083 else
8184 echo "No formatting changes to commit."
8285 fi
8386
84- elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
85- echo "PR from fork : Running black and isort in check mode"
87+ elif [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
88+ echo "PR or manual run : Running black and isort in check mode"
8689 black --check . || { echo "Black formatting issues found. Run 'black .' to fix."; exit 1; }
8790 isort --check-only . || { echo "isort import order issues found. Run 'isort .' to fix."; exit 1; }
8891
9598 runs-on : ubuntu-latest
9699 if : |
97100 github.event_name == 'push' ||
101+ github.event_name == 'workflow_dispatch' ||
98102 (
99103 github.event_name == 'pull_request' &&
100104 github.repository != github.event.pull_request.head.repo.full_name
0 commit comments