From e42eb74a58ebd0d9dc36480494aae5d6ea0aa9cc Mon Sep 17 00:00:00 2001 From: Natsu Date: Mon, 1 Jul 2024 11:12:20 +0700 Subject: [PATCH] chore(dispatch.yml): update workflow to install dependencies and format/sort JSON files fix(dispatch.yml): fix prettier and sort-json installation commands chore(dispatch.yml): update commit message to reflect formatting and sorting of JSON files --- .github/workflows/dispatch.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml index fbe17fbc..5aff969c 100644 --- a/.github/workflows/dispatch.yml +++ b/.github/workflows/dispatch.yml @@ -54,18 +54,14 @@ jobs: with: node-version: '18' - - name: Install Prettier and JSON Sort Plugin - run: npm install --global prettier prettier-plugin-sort-json - - - name: Create Prettier Configuration - run: | - echo '{ - "plugins": ["prettier-plugin-sort-json"], - "jsonRecursiveSort": true - }' > .prettierrc.json + - name: Install Dependencies + run: npm install --global prettier sort-json - - name: Run Prettier to format JSON files - run: prettier --plugin-search-dir "$(npm root -g)" --write "local-files/**/*.json" + - name: Run Prettier + run: prettier --write "local-files/**/*.json" + + - name: Sort JSON files + run: find local-files -type f -name '*.json' -exec sort-json {} \; - name: Authorize Git run: | @@ -75,7 +71,7 @@ jobs: - name: Commit Changes run: | git add local-files/**/*.json - git commit -m "chore(format): Format JSON files with Prettier" + git commit -m "chore(format): Format and Sort JSON files" git push origin main env: GITHUB_TOKEN: ${{ secrets.PAT }}