Skip to content

prettier test

prettier test #10

name: Prettier Auto-Format
on:
push:
branches:
- feat/add-prettier-format
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Check Out Repository
uses: actions/checkout@v2
- name: Install Prettier
run: npm install prettier --global
- name: Format Files
run: |
prettier --write .
- name: Commit Changes
if: ${{ env.MODIFIED_FILES != '' }}
run: |
git config --global user.name "Your GitHub Username"
git config --global user.email "[email protected]"
git add .
git commit -m "Auto-format code with Prettier [skip ci]"
- name: Push Changes
if: ${{ env.MODIFIED_FILES != '' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}