Skip to content

Commit

Permalink
Merge 6b24f04 into 9d3165b
Browse files Browse the repository at this point in the history
  • Loading branch information
Waelthus committed Jan 24, 2023
2 parents 9d3165b + 6b24f04 commit 3663a56
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/autoyapf.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
name: Autoyapf

on: [push, pull_request]
on:
push:
paths:
- '**.py'
jobs:
autoyapf:
runs-on: ubuntu-latest
steps:
- run: echo "In the future this will run the automatic formatting"
- uses: actions/checkout@master
with:
ref: ${{ github.head_ref }}
- name: autoyapf
id: autoyapf
uses: mritunjaysharma394/autoyapf@v2
with:
args: --style google --recursive --in-place .
- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_ENV
- name: Push changes
if: env.modified == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.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

0 comments on commit 3663a56

Please sign in to comment.