Skip to content

Retrieve Project Info and Host Badges on GitHub #15

Retrieve Project Info and Host Badges on GitHub

Retrieve Project Info and Host Badges on GitHub #15

name: Retrieve Project Info and Host Badges on GitHub
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
branches:
- main
jobs:
retrieve-and-host:
runs-on: ubuntu-latest
env:
API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
PROJECT_ID: ${{ secrets.LOKALISE_PROJECT_ID }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch project info & Render badges
run: |
chmod +x ./render.sh
./render.sh
- name: Commit & 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 ./badges --porcelain) ]]; then
echo "No changes to commit."
exit 0
fi
cd badges && \
git add . && \
git commit -m "chore: update Lokalise project info" && \
git push