Browse Source

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

pull/1513/head
nprimo 1 year ago committed by Niccolò Primo
parent
commit
4ad986c7ea
  1. 26
      .github/workflows/ga-misc-check-prettier.yml

26
.github/workflows/ga-misc-check-prettier.yml

@ -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}}
Loading…
Cancel
Save