mirror of
https://github.com/NatsumeLS/Gakumas-Translation-Data-EN.git
synced 2026-02-04 09:04:54 +00:00
chore(ci): Update workflow to use Ubuntu 22.04 and improve JSON formatting
This commit is contained in:
18
.github/workflows/check.yml
vendored
18
.github/workflows/check.yml
vendored
@@ -5,7 +5,7 @@ on: [push, pull_request, workflow_dispatch]
|
|||||||
jobs:
|
jobs:
|
||||||
validate:
|
validate:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
|
|
||||||
format:
|
format:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
needs: validate
|
needs: validate
|
||||||
|
|
||||||
@@ -57,11 +57,14 @@ jobs:
|
|||||||
run: npm install --global prettier sort-json
|
run: npm install --global prettier sort-json
|
||||||
|
|
||||||
- name: Run Prettier
|
- name: Run Prettier
|
||||||
run: prettier --write "local-files/*.json" "local-files/genericTrans/index/*.json" "local-files/genericTrans/lyrics/*.json"
|
run: prettier --write "local-files/genericTrans/index/*.json" "local-files/genericTrans/lyrics/*.json" "local-files/generic.json" "local-files/localization.json"
|
||||||
|
|
||||||
|
# Do not ever sort lyrics alphabetically...
|
||||||
- name: Sort JSON files
|
- name: Sort JSON files
|
||||||
run: find local-files -type f -name '*.json' -not -path "local-files/genericTrans/*" -not -path "local-files/masterTrans/*" -exec sort-json {} +
|
run: |
|
||||||
|
find local-files/genericTrans/index -type f -exec sort-json {} +
|
||||||
|
sort-json local-files/generic.json
|
||||||
|
sort-json local-files/localization.json
|
||||||
|
|
||||||
- name: Authorize Git
|
- name: Authorize Git
|
||||||
run: |
|
run: |
|
||||||
@@ -70,8 +73,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Commit Changes
|
- name: Commit Changes
|
||||||
run: |
|
run: |
|
||||||
git add local-files/*.json local-files/**/*.json
|
git commit -am "chore(format): Format and Sort JSON files"
|
||||||
git commit -m "chore(format): Format and Sort JSON files"
|
|
||||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
git push origin HEAD:${{ github.head_ref }}
|
git push origin HEAD:${{ github.head_ref }}
|
||||||
else
|
else
|
||||||
@@ -83,7 +85,7 @@ jobs:
|
|||||||
|
|
||||||
update:
|
update:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
needs: [validate, format]
|
needs: [validate, format]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user