Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslansenatorov committed Nov 7, 2024
2 parents 53ad16b + 2502ee2 commit d95fff6
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,33 @@ on:
issues:
pull_request_review:
pull_request_review_comment:

jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: isort/isort-action@v1
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install isort nbqa
- name: isort
run: |
nbqa isort --check --float-to-top $(git ls-files '*.ipynb')
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install isort nbqa
- name: Run isort and auto-fix imports
run: |
nbqa isort --float-to-top $(git ls-files '*.ipynb')
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Apply isort changes"
git push
continue-on-error: true # To avoid failing if there are no changes

0 comments on commit d95fff6

Please sign in to comment.