2020-07-07 18:30:58 +03:00
|
|
|
name: Build locales coverage
|
2020-06-30 19:28:19 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-02-20 14:47:17 +02:00
|
|
|
- l10n_master
|
2020-06-30 19:28:19 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
locales:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
|
|
|
|
2023-07-27 23:50:11 +05:30
|
|
|
- name: Setup Node.js 18.x
|
2021-02-20 16:28:33 +02:00
|
|
|
uses: actions/setup-node@v2
|
2020-06-30 19:28:19 +01:00
|
|
|
with:
|
2023-07-27 23:50:11 +05:30
|
|
|
node-version: 18.x
|
2020-06-30 19:28:19 +01:00
|
|
|
|
|
|
|
- name: Create report file
|
|
|
|
run: |
|
2021-02-20 14:47:17 +02:00
|
|
|
yarn locales-coverage
|
2023-12-12 11:32:51 +05:30
|
|
|
FILE_CHANGED=$(git diff packages/excalidraw/locales/percentages.json)
|
2020-06-30 19:28:19 +01:00
|
|
|
if [ ! -z "${FILE_CHANGED}" ]; then
|
2021-01-22 18:06:21 +02:00
|
|
|
git config --global user.name 'Excalidraw Bot'
|
|
|
|
git config --global user.email 'bot@excalidraw.com'
|
2023-12-12 11:32:51 +05:30
|
|
|
git add packages/excalidraw/locales/percentages.json
|
2020-06-30 19:28:19 +01:00
|
|
|
git commit -am "Auto commit: Calculate translation coverage"
|
|
|
|
git push
|
|
|
|
fi
|
2020-12-19 15:52:50 +02:00
|
|
|
- name: Construct comment body
|
|
|
|
id: getCommentBody
|
|
|
|
run: |
|
2021-03-05 17:09:40 +02:00
|
|
|
body=$(npm run locales-coverage:description | grep '^[^>]')
|
2020-12-19 22:44:01 +02:00
|
|
|
body="${body//'%'/'%25'}"
|
|
|
|
body="${body//$'\n'/'%0A'}"
|
|
|
|
body="${body//$'\r'/'%0D'}"
|
|
|
|
echo ::set-output name=body::$body
|
|
|
|
|
|
|
|
- name: Update description with coverage
|
|
|
|
uses: kt3k/update-pr-description@v1.0.1
|
2020-12-19 15:52:50 +02:00
|
|
|
with:
|
2020-12-19 22:44:01 +02:00
|
|
|
pr_body: ${{ steps.getCommentBody.outputs.body }}
|
2021-01-14 12:09:05 +02:00
|
|
|
pr_title: "chore: Update translations from Crowdin"
|
2020-12-19 22:44:01 +02:00
|
|
|
github_token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|