Retrieve Project Info and Host Badges on GitHub #54
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: 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@v4 | |
- 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 |