Feature bhushan1 #14
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: Autopep8 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
autopep8: | |
name: Autopep8 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Environment | |
run: | | |
chmod +x ./.github/workflows/setup.sh && ./.github/workflows/setup.sh | |
pip install autopep8 pre-commit | |
- name: Format code with autopep8 | |
run: | | |
autopep8 --in-place ./hw2_debugging.py | |
git diff ./hw2_debugging.py | |
if [ -n "$(git diff ./hw2_debugging.py)" ]; then | |
echo "Code is not formatted. Please run autopep8 locally." | |
exit 1 | |
fi | |
env: | |
REPO_TOKEN: ${{ secrets.REPO_TOKEN }} |