Skip to content

Update translations (#11) #16

Update translations (#11)

Update translations (#11) #16

Workflow file for this run

name: Update Metadata
on:
workflow_dispatch:
push:
branches:
- "main"
jobs:
generate:
name: Generate metadata
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate metadata.json
run: |
echo "{\"timestamp\": $(date +%s), \"languages\": [$(ls translations/*.lang.json | sed 's/translations\///;s/.lang.json//;s/^/"/;s/$/"/' | paste -sd,)]}" > ../metadata.json
- name: Update metadata branch
run: |
if git show-ref --verify --quiet refs/remotes/origin/metadata; then
git checkout metadata
git pull origin metadata
else
git checkout --orphan metadata
git rm -rf .
fi
mv ../metadata.json metadata.json
git add metadata.json
git config --global user.email "bot@eclipse.menu"
git config --global user.name "Eclipse Menu Bot"
git commit -m "Update metadata"
git push origin metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}