-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 1.03 KB
/
retrieve-and-host.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
name: Retrieve Project Info and Host on GitHub
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
branches:
- main
jobs:
retrieve-and-host:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Call API and get data
env:
API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
PROJECT_ID: ${{ secrets.LOKALISE_PROJECT_ID }}
run: |
curl -s --request GET --url https://api.lokalise.com/api2/projects/$PROJECT_ID --header 'accept: application/json' --header "X-Api-Token: $API_TOKEN" | jq -f schema.jq > badge.json
- name: Commit and push data
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if [[ -z $(git status --porcelain) ]]; then
echo "No changes to commit."
exit 0
fi
git add .
git commit -m "chore: update Lokalise project info"
git push