This repository was archived by the owner on Jun 13, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
38 lines (35 loc) · 1.07 KB
/
pythonformat.yml
File metadata and controls
38 lines (35 loc) · 1.07 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
# Runs a flake8 analysis on the pull request.
name: PythonFormat
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
PythonFormat:
# Set up virtual machine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
# Set up environment
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install yapf
# If needed, format code with yapf formatter
- name: Format with yapf
run: |
yapf --style "pep8" -pir . -vv
git config --global user.name github-actions
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git commit -am "fixup! Format Python code with yapf" || true
git push --force origin HEAD:$GITHUB_REF || true