mirror of https://github.com/01-edu/public.git
feat(ga-misc-check-prettier): add github action to check prettier
This commit is contained in:
parent
4eb5c5cc43
commit
4ad986c7ea
|
@ -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…
Reference in New Issue