Fix spelling and grammatical errors in README #381
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: Python Indentation Check and Pull Request | |
on: | |
push: | |
branches: | |
- main # Change this to your main branch name if different | |
jobs: | |
indent_check_and_pr: | |
name: Indentation Check and Pull Request | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' # Replace with the version of Python used in your repository | |
- name: Install flake8 and black | |
run: | | |
pip install flake8 black | |
- name: Run flake8 for Indentation Errors | |
id: check_indentation | |
run: | | |
if flake8 --select=E --show-source --quiet .; then | |
echo "No indentation errors found." | |
else | |
echo "Indentation errors found. Fixing the errors..." | |
black . | |
git add . | |
fi | |
- name: Commit and push changes | |
if: steps.check_indentation.outputs.result == 'failure' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Fix Python indentation errors" || true | |
git push origin HEAD | |
- name: Create Pull Request | |
if: steps.check_indentation.outputs.result == 'failure' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Fix Python indentation errors" | |
title: "Fix Python indentation errors" | |
body: "This pull request fixes Python indentation errors identified by flake8." | |
base: main | |
branch: fix-indentation-errors |