Browse Source

feat(ga-misc-check-prettier): simplify ga action

- remove creyD/prettier_action marketplace action and replace
it with two separate jobs
pull/1513/head
nprimo 11 months ago committed by Niccolò Primo
parent
commit
ec3a9cb195
  1. 22
      .github/workflows/ga-misc-check-prettier.yml

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

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