This repository has been archived by the owner on Jul 27, 2024. It is now read-only.
Update Dockerfile #34
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: Style | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
auto-format: | |
name: Format code with Black | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- run: pip install black | |
- name: Format code with Black and commit any changes | |
run: | | |
black . | |
git config --global user.name 'Auto Black Formatter' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
git checkout ${GITHUB_REF#refs/heads/} | |
git diff --quiet || git commit -am "Format code with Black [auto]" && git push |