Skip to content

Commit

Permalink
make it do a commit instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbyperson committed Oct 9, 2024
1 parent 17366ad commit cabc393
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ on: [push, pull_request]

permissions:
contents: write
pull-requests: write

jobs:
format_code:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 2 # Fetch enough history to amend the last commit

- name: Set Up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -41,11 +40,12 @@ jobs:
echo "changes_detected=false" >> $GITHUB_OUTPUT
fi
- name: Amend Last Commit and Force Push
- name: Create Pull Request with Formatting Changes
if: steps.check_changes.outputs.changes_detected == 'true'
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git add .
git commit --amend --no-edit
git push --force-with-lease
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Apply code formatting"
branch: formatting-fixes
title: "Apply code formatting"
body: "This pull request applies code formatting using isort, ruff, and black."
delete-branch: true

0 comments on commit cabc393

Please sign in to comment.