Skip to content

Commit

Permalink
⏪ Revert to first code
Browse files Browse the repository at this point in the history
  • Loading branch information
NTGNguyen committed Sep 9, 2024
1 parent 6a62823 commit 5c1a62c
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Pre-commit Auto Fix
on:
push:
branches:
- main # Change this to your default branch if it's not 'main'
- main

jobs:
pre-commit:
Expand All @@ -28,34 +28,14 @@ jobs:
pip install pre-commit
- name: Run pre-commit
id: run_pre_commit
run: pre-commit run --all-files || true

- name: Create new branch
run: |
git checkout -b auto/pre-commit-fix
- name: Pull latest changes
run: |
git pull origin main
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "🎨 Auto Code Fix (Pre-commit)" || echo "No changes to commit"
git push --set-upstream origin auto/pre-commit-fix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pre-commit run --all-files

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "🎨 Auto Code Fix (Pre-commit)"
branch: auto/pre-commit-fix
base: main
title: "🎨 Auto Code Fix (Pre-commit)"
body: "This pull request contains auto code fixes from pre-commit."
labels: |
Expand Down

0 comments on commit 5c1a62c

Please sign in to comment.