2023-11-20 21:35:24 +08:00
|
|
|
name: Download translation files from Localazy
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
secrets:
|
|
|
|
ELEMENT_BOT_TOKEN:
|
|
|
|
required: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
download:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout the code
|
2024-06-21 21:21:08 +08:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
|
2023-11-20 21:35:24 +08:00
|
|
|
|
2024-08-01 09:04:00 +08:00
|
|
|
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
|
2023-11-20 21:35:24 +08:00
|
|
|
with:
|
|
|
|
cache: "yarn"
|
2024-07-24 23:12:36 +08:00
|
|
|
node-version: "lts/*"
|
2023-11-20 21:35:24 +08:00
|
|
|
|
|
|
|
- name: Install Deps
|
|
|
|
run: "yarn install --frozen-lockfile"
|
|
|
|
|
|
|
|
- name: Prune i18n
|
|
|
|
run: "rm -R public/locales"
|
|
|
|
|
|
|
|
- name: Download translation files
|
2024-06-21 21:21:08 +08:00
|
|
|
uses: localazy/download@0a79880fb66150601e3b43606fab69c88123c087 # v1.1.0
|
2023-11-20 21:35:24 +08:00
|
|
|
with:
|
|
|
|
groups: "-p includeSourceLang:true"
|
|
|
|
|
|
|
|
- name: Fix the owner of the downloaded files
|
|
|
|
run: "sudo chown runner:docker -R public/locales"
|
|
|
|
|
|
|
|
- name: Prettier
|
|
|
|
run: yarn prettier:format
|
|
|
|
|
|
|
|
- name: Create Pull Request
|
|
|
|
id: cpr
|
2024-09-13 01:40:58 +08:00
|
|
|
uses: peter-evans/create-pull-request@d121e62763d8cc35b5fb1710e887d6e69a52d3a4 # v7.0.2
|
2023-11-20 21:35:24 +08:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
|
|
branch: actions/localazy-download
|
|
|
|
delete-branch: true
|
|
|
|
title: Localazy Download
|
|
|
|
commit-message: Translations updates
|
|
|
|
labels: |
|
|
|
|
T-Task
|
|
|
|
|
|
|
|
- name: Enable automerge
|
|
|
|
run: gh pr merge --merge --auto "$PR_NUMBER"
|
|
|
|
if: steps.cpr.outputs.pull-request-operation == 'created'
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
|
|
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
|