Skip to content

olance/isort-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isort Code Formatter GitHub Action

A GitHub action that runs isort for Python.

Example Workflow

name: Sort imports with isort

on:
  pull_request:
    branches: [master]
    types: [closed]

jobs:
  format:

    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
      
    - name: Run isort
      uses: olance/isort-action@v1.0.0
      with:
        args: .
      
    - name: Commit changes
      run: |
        git config --local user.email "action@github.com"
        git config --local user.name "GitHub Action"
        git add -A && git diff-index --cached --quiet HEAD || git commit -m 'isort'
      
    - name: Push changes
      uses: ad-m/github-push-action@v0.5.0
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}

For a full list of possible args checkout the isort docs.

About

A Github Action to run `isort` on a Python codebase

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors