Update CMakeLists.txt #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |