forked from rohan22shah/slash-phase3
-
Notifications
You must be signed in to change notification settings - Fork 3
29 lines (29 loc) · 976 Bytes
/
code_formatter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Format
on:
pull_request:
branches: [main]
paths:
- '**.py'
jobs:
autoyapf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.head_ref }}
- name: autoyapf
id: autoyapf
uses: mritunjaysharma394/autoyapf@v2
with:
args: --style pep8 --recursive --in-place .
- name: Check for modified files
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
- name: Push changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Kashika08'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GIT_TOKEN }}@github.com/${{ Kashika08/ShopSync }}
git commit -am "Automated autoyapf fixes"
git push