Skip to content

Commit

Permalink
Update django.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
edbourque0 authored Apr 16, 2024
1 parent 3042bb6 commit 0719c16
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensures you fetch all history for .git files
token: ${{ secrets.GITHUB_TOKEN }} # Ensures the checkout action has permission to check out the code

- name: Set up Python 3.12
uses: actions/setup-python@v3
Expand Down Expand Up @@ -46,14 +43,18 @@ jobs:
- name: Install Black
run: pip install black

- name: Run Black and check for changes
- name: Run Black
run: |
cd clashstats
black . --check --diff
black .
- name: Commit changes if any
if: ${{ steps.black.outputs.has-changes == 'true' }}
- name: Commit changes
run: |
git add -A
git commit -m "Format Python code with Black"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -u
git commit -m "Format Python code with Black" || echo "No changes to commit"
git push origin HEAD:${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0719c16

Please sign in to comment.