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 1 year 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 - name: 🐧 Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: ${{ github.head_ref }} fetch-depth: 2 # OR "2" -> To retrieve the preceding commit.
fetch-depth: 0
- name: 💄 Run Prettier - name: Get all changed *.md file(s)
uses: creyD/prettier_action@v4.3 id: changed-md
with: run: |
prettier_options: --write **/*.{js,md,yml,json,sh} echo "changed_files=$(git diff --name-only --merge-base master | grep "\.md$" | xargs)" >> $GITHUB_OUTPUT
prettier_plugins: 'prettier-plugin-sh'
commit_message: "chore(codebase): format with prettier" - name: Run step if any *.md file(s) changed
only_changed: True if: steps.changed-md.outputs.changed_files != ''
env: run: |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} npm i -g prettier
npx prettier -c ${{ steps.changed-md.outputs.changed_files }}

Loading…
Cancel
Save