Update README.md #23
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: Formatting Python Code | |
| on: push | |
| permissions: | |
| contents: write # ✅ Allow pushing changes | |
| jobs: | |
| autoyapf: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - name: Format Python code with YAPF | |
| id: automated-yapf | |
| uses: KaustubhAs/automated-yapf-action@v1 | |
| with: | |
| args: --style pep8 --recursive --in-place . | |
| - name: Check for modified files | |
| id: git-check | |
| run: | | |
| if git diff-index --quiet HEAD --; then | |
| echo "modified=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "modified=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Push changes | |
| if: steps.git-check.outputs.modified == 'true' | |
| run: | | |
| git config --global user.name 'kaustubhAS' | |
| git config --global user.email 'kaustubhsonawane13@gmail.com' | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
| git commit -am "Automated autoyapf fixes" | |
| git push |