mirror of
https://github.com/NatsumeLS/Gakumas-Translation-Data-EN.git
synced 2026-02-04 09:04:54 +00:00
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
This commit is contained in:
18
.github/workflows/dispatch.yml
vendored
18
.github/workflows/dispatch.yml
vendored
@@ -54,18 +54,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '18'
|
||||||
|
|
||||||
- name: Install Prettier and JSON Sort Plugin
|
- name: Install Dependencies
|
||||||
run: npm install --global prettier prettier-plugin-sort-json
|
run: npm install --global prettier sort-json
|
||||||
|
|
||||||
- name: Create Prettier Configuration
|
- name: Run Prettier
|
||||||
run: |
|
run: prettier --write "local-files/**/*.json"
|
||||||
echo '{
|
|
||||||
"plugins": ["prettier-plugin-sort-json"],
|
|
||||||
"jsonRecursiveSort": true
|
|
||||||
}' > .prettierrc.json
|
|
||||||
|
|
||||||
- name: Run Prettier to format JSON files
|
- name: Sort JSON files
|
||||||
run: prettier --plugin-search-dir "$(npm root -g)" --write "local-files/**/*.json"
|
run: find local-files -type f -name '*.json' -exec sort-json {} \;
|
||||||
|
|
||||||
- name: Authorize Git
|
- name: Authorize Git
|
||||||
run: |
|
run: |
|
||||||
@@ -75,7 +71,7 @@ jobs:
|
|||||||
- name: Commit Changes
|
- name: Commit Changes
|
||||||
run: |
|
run: |
|
||||||
git add local-files/**/*.json
|
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
|
git push origin main
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
|
|||||||
Reference in New Issue
Block a user