Skip to content

Commit

Permalink
Create yapf_autoformat
Browse files Browse the repository at this point in the history
  • Loading branch information
surajpaib authored Jan 24, 2022
1 parent f2534ad commit 6a75a54
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/yapf_autoformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: YAPF autoformat

on:
push:
paths:
- "**.py"

jobs:
build:
name: YAPF Formatter
runs-on: ubuntu-latest

steps:
- name: checkout repo
uses: actions/[email protected]
with:
repository: ${{ github.repository }}
token: ${{ github.token }}

# https://github.com/diegovalenzuelaiturra/yapf-action
- name: YAPF Formatter
uses: diegovalenzuelaiturra/yapf-action@master
with:
args: . --verbose --recursive --in-place --parallel

- name: action metadata
run: |
echo -e "action : ${{ github.action }}"
echo -e "actor : ${{ github.actor }}"
echo -e "event_name : ${{ github.event_name }}"
echo -e "job : ${{ github.job }}"
echo -e "ref : ${{ github.ref }}"
echo -e "repository : ${{ github.repository }}"
echo -e "run_id : ${{ github.run_id }}"
echo -e "sha : ${{ github.sha }}"
echo -e "workflow : ${{ github.workflow }}"
echo -e "workspace : ${{ github.workspace }}"

- name: config github
run: |
git config user.name github-actions
git config user.email [email protected]

- name: add changes
run: |
git add .

- name: commit changes
run: |
git commit -m "Autoformatted to YAPF" --all | exit 0

# NOTE : only push changes when the source branch is being pushed to master (target branch)
- name: push changes
if: github.ref == 'refs/heads/master'
run: |
git push

0 comments on commit 6a75a54

Please sign in to comment.