-
Notifications
You must be signed in to change notification settings - Fork 16
45 lines (43 loc) · 1.38 KB
/
autoyapf.yml
File metadata and controls
45 lines (43 loc) · 1.38 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: autoyapf
on:
pull_request:
branches:
- master
paths:
- '**.py'
jobs:
label:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8.10]
steps:
- uses: actions/checkout@v2
with:
ref: ${{github.head_ref}}
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Installing PEP8
run: |
python -m pip install --upgrade pip
pip install yapf
yapf -i -r -vv -p codedigger/
# URL="https://api.github.com/repos/${{github.repository}}/pulls/${{ github.event.pull_request.number }}/files?per_page=100"
# FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename')
# echo $FILES
- 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: Git Push Changes
if: steps.git-check.outputs.modified == 'true'
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "refactor: automatic code reformatting to PEP8 by yapf"
git push