Update chatbot.py #5
This file contains hidden or 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: Auto Fix Code | |
| on: | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| jobs: | |
| autofix: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install tools | |
| run: | | |
| pip install black autopep8 isort | |
| - name: Auto fix code | |
| run: | | |
| autopep8 --in-place --recursive . | |
| black . | |
| isort . | |
| - name: Commit changes | |
| run: | | |
| git config --global user.name "auto-fix-bot" | |
| git config --global user.email "bot@users.noreply.github.com" | |
| git add . | |
| git diff --cached --quiet || git commit -m "🤖 Auto fix code (format + lint)" | |
| git push |