feat(ga-misc-check-prettier): add github action to check prettier

This commit is contained in:
nprimo 2023-04-17 16:38:22 +01:00 committed by Niccolò Primo
parent 4eb5c5cc43
commit 4ad986c7ea
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
name: 'Prettier check'
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: Run prettier on changed files
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get all changed *.md file(s)
id: changed-md
uses: tj-actions/changed-files@v35
with:
files: |
**/*.md
- name: Run step if any *.md file(s) changed
if: steps.changed-md.outputs.any_changed == 'true'
run: |
npm i -g prettier
npx prettier -c ${{steps.changed-md.outputs.all_changed_files}}