Skip to content

Commit

Permalink
Add auto formatting when committing to master
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Dec 11, 2019
1 parent db18d20 commit e29ebaf
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Python Code Formatting (Black)

on:
push:
branches:
- master

jobs:
format:
runs-on: ubuntu-latest

container:
image: python:3.7.4-alpine

steps:
- uses: actions/checkout@v1
- name: Install Black
run: apk add gcc musl-dev && pip install black
- name: Run Black
run: black redash tests migrations/versions
- name: Commit formatted code
uses: EndBug/[email protected]
with:
author_name: Black
author_email: [email protected]
message: "Autoformatted Python code with Black"
path: "."
pattern: "*.py"
force: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e29ebaf

Please sign in to comment.