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 0719c16 commit 33a578f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ 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 @@ -43,18 +46,17 @@ jobs:
- name: Install Black
run: pip install black

- name: Run Black
- name: Run Black and check for changes
run: |
cd clashstats
black .
black . --check --diff
- name: Commit changes
run: |
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 }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Format Python code with Black"
title: "Automated Code Formatting"
body: "This is an auto-generated PR with code formatting changes"
branch: "format-code-${{ github.run_number }}"
delete-branch: true

0 comments on commit 33a578f

Please sign in to comment.