create a Prettier GitHub Action for people.json (close #18)

This commit is contained in:
Frédéric Harper
2022-04-30 18:31:23 -04:00
parent b0b3984d92
commit 4ac7a17401
2 changed files with 35 additions and 0 deletions

32
.github/workflows/prettify-json.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Prettify people.json
on:
push:
branches:
- main
paths:
- 'people.json'
jobs:
prettify-json:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTIONS_TOKEN }}
- name: Setting up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Run prettier
run: npx prettier --write people.json
- name: Commit the changes
uses: EndBug/add-and-commit@v9
with:
add: 'people.json'
author_name: 'GitHub Actions'
author_email: 'actions@github.com'
message: 'prettify people.json'

3
.prettierrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"tabWidth": 4
}