Move this to run locally instead of Actions

Seems like it can't run based on PR closed by another workflow, which make sense.
This commit is contained in:
Lim Chee Aun 2024-08-21 23:48:08 +08:00
parent ca536723e9
commit c54228627c
2 changed files with 5 additions and 30 deletions

View file

@ -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

View file

@ -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(),