Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 683 Bytes

github_actions.md

File metadata and controls

32 lines (24 loc) · 683 Bytes

GitHub Actions integration

You can use Black within a GitHub Actions workflow without setting your own Python environment. Great for enforcing that your code matches the Black code style.

Usage

Create a file named .github/workflows/black.yml inside your repository with:

name: Lint

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - uses: psf/black@stable

You may use options (Default is '--check --diff') and src (Default is '.') as follows:

- uses: psf/black@stable
  with:
    options: "--check --verbose"
    src: "./src"