Skip to content

Download Localized Strings #1554

Download Localized Strings

Download Localized Strings #1554

name: Download Localized Strings
on:
workflow_dispatch:
schedule:
# If there are no changes, this does nothing. If there are changes, it either creates or updates an existing PR.
- cron: '0 6 * * *'
env:
HOMEBREW_NO_INSTALL_CLEANUP: TRUE
BUNDLE_PATH: vendor/bundle
jobs:
update_strings:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.HOMEASSISTANT_SSH_DEPLOY_KEY }}
- name: Install Brews
run: brew bundle
- name: Install Gems
run: bundle install --jobs 4 --retry 3
- name: Install Pods
run: ONLY_SUPPORT_MODULES=1 bundle exec pod install --repo-update
- name: Upload to Lokalise
run: bundle exec fastlane push_strings
env:
HOMEASSISTANT_LOKALIZE_PROJECT_ID: ${{ secrets.HOMEASSISTANT_LOKALIZE_PROJECT_ID }}
HOMEASSISTANT_LOKALIZE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
- name: Download from Lokalise
run: bundle exec fastlane update_strings
env:
HOMEASSISTANT_LOKALIZE_PROJECT_ID: ${{ secrets.HOMEASSISTANT_LOKALIZE_PROJECT_ID }}
HOMEASSISTANT_LOKALIZE_PROJECT_FRONTEND: ${{ secrets.HOMEASSISTANT_LOKALIZE_PROJECT_FRONTEND }}
HOMEASSISTANT_LOKALIZE_PROJECT_CORE: ${{ secrets.HOMEASSISTANT_LOKALIZE_PROJECT_CORE }}
HOMEASSISTANT_LOKALIZE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
- name: Commit changes
id: commit
run: |
git config --global user.name 'Home Assistant Bot'
git config --global user.email '[email protected]'
git add Sources/\*.strings
git add Sources/\*.swift
git commit -m "Update Localized Strings" || true
git checkout -- .
git clean -xfd
echo ::set-output name=pr_title::"$(git log -1 --pretty='%s')"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
base: master
branch: create-pull-request/download_strings
title: ${{ steps.commit.outputs.pr_title }}
body: "Automatically created by ${{ github.actor }}."