-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (35 loc) · 1.13 KB
/
refresh-meta.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 }}