Update README.md #33
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
name: Run pre-commit | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'releases/**' | |
workflow_dispatch: | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install pre-commit | |
run: | | |
python -m pip install --upgrade pip | |
pip install pre-commit | |
pre-commit install | |
- name: Run pre-commit hooks | |
run: pre-commit run --all-files | |
- name: Commit and push changes | |
if: success() && steps.pre-commit.outputs.changed == 'true' | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Fixed Code Quality" | |
git push | |
- name: Create pull request | |
if: success() && steps.pre-commit.outputs.changed == 'true' | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
title: "Automated Code Quality Fixes" | |
body: "This pull request includes automated fixes for code quality issues." | |
base: main | |
branch: automated-fixes |