name: Format Code on: push: paths: - '**.py' jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 with: python-version: 3.8 - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements-lint.txt - name: Code Format Check with Black run: | black --verbose . - name: Commit Formated Code uses: EndBug/add-and-commit@v5 env: # This is necessary in order to push a commit to the repo GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: message: "Format code with black" # Ref https://git-scm.com/docs/git-add#_examples add: './*.py'