mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
678 B
27 lines
678 B
2 years ago
|
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}}
|