format python with black #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Black Formatter | |
on: | |
workflow_call: | |
inputs: | |
command: | |
type: string | |
required: false | |
default: 'black .' | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Format with Black | |
run: | | |
python -m pip install --upgrade pip | |
pip install black | |
${{ github.event.inputs.command }} | |
- | |
name: Commit changes | |
uses: NelsonDane/Custom-GitHub-Actions/.github/workflows/commit-to-github.yml@main | |
with: | |
message: "Auto-format with Black" |