Merge pull request #9 from NTGNguyen/auto/pre-commit-fix #28
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
#Precommit-Action | |
name: Pre-commit Auto Fix | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
if: ${{ always() }} | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
- name: Run pre-commit | |
if: ${{ always() }} | |
run: pre-commit run --all-files | |
- name: Create Pull Request | |
if: ${{ always() }} | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "🎨 Auto Code Fix (Pre-commit)" | |
branch: auto/pre-commit-fix | |
title: "🎨 Auto Code Fix (Pre-commit)" | |
body: "This pull request contains auto code fixes from pre-commit." | |
labels: | | |
auto-fix | |
pre-commit |