This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
update environment #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: YAPF Formatter | |
on: | |
push: | |
paths: | |
- "**.py" | |
jobs: | |
build: | |
name: YAPF Formatter | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: checkout repo | |
uses: actions/[email protected] | |
with: | |
repository: ${{ github.repository }} | |
token: ${{ github.token }} | |
- 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 "Automated YAPF Formatting" --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 |