mirror of https://github.com/01-edu/public.git
feat(ga-misc-check-prettier): simplify ga action
- remove creyD/prettier_action marketplace action and replace it with two separate jobs
This commit is contained in:
parent
56ab5c7fa3
commit
ec3a9cb195
|
@ -14,15 +14,15 @@ jobs:
|
|||
- name: 🐧 Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
fetch-depth: 0
|
||||
fetch-depth: 2 # OR "2" -> To retrieve the preceding commit.
|
||||
|
||||
- name: 💄 Run Prettier
|
||||
uses: creyD/prettier_action@v4.3
|
||||
with:
|
||||
prettier_options: --write **/*.{js,md,yml,json,sh}
|
||||
prettier_plugins: 'prettier-plugin-sh'
|
||||
commit_message: "chore(codebase): format with prettier"
|
||||
only_changed: True
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get all changed *.md file(s)
|
||||
id: changed-md
|
||||
run: |
|
||||
echo "changed_files=$(git diff --name-only --merge-base master | grep "\.md$" | xargs)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Run step if any *.md file(s) changed
|
||||
if: steps.changed-md.outputs.changed_files != ''
|
||||
run: |
|
||||
npm i -g prettier
|
||||
npx prettier -c ${{ steps.changed-md.outputs.changed_files }}
|
||||
|
|
Loading…
Reference in New Issue