From c54228627c0d167b2450ff322fc6deccd4829b87 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 21 Aug 2024 23:48:08 +0800 Subject: [PATCH] Move this to run locally instead of Actions Seems like it can't run based on PR closed by another workflow, which make sense. --- .github/workflows/update-catalogs.yml | 30 --------------------------- vite.config.js | 5 +++++ 2 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/update-catalogs.yml diff --git a/.github/workflows/update-catalogs.yml b/.github/workflows/update-catalogs.yml deleted file mode 100644 index 934fab22..00000000 --- a/.github/workflows/update-catalogs.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Update catalogs - -on: - pull_request: - types: - - closed - workflow_dispatch: - -jobs: - update-catalogs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm ci - - name: Update catalogs.json - run: | - node scripts/catalogs.js - if git diff --quiet src/data/catalogs.json; then - echo "No changes to catalogs.json" - else - echo "Changes to catalogs.json" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git add src/data/catalogs.json - git commit -m "Update catalogs.json" - git push origin HEAD:main - fi diff --git a/vite.config.js b/vite.config.js index fc085f66..7bf25f11 100644 --- a/vite.config.js +++ b/vite.config.js @@ -70,6 +70,11 @@ export default defineConfig({ run: ['npm', 'run', 'messages:extract:clean'], pattern: 'src/**/*.{js,jsx,ts,tsx}', }, + { + name: 'update-catalogs', + run: ['node', 'scripts/catalogs.js'], + pattern: 'src/locales/*.po', + }, ], }), splitVendorChunkPlugin(),