2020-07-07 17:30:58 +02:00
|
|
|
name: Build locales coverage
|
2020-06-30 20:28:19 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-07-01 11:05:21 +02:00
|
|
|
- "l10n_master"
|
2020-06-30 20:28:19 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
locales:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
|
|
|
|
|
|
|
- name: Setup Node.js 12.x
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12.x
|
|
|
|
|
|
|
|
- name: Create report file
|
|
|
|
run: |
|
|
|
|
npm run locales-coverage
|
|
|
|
FILE_CHANGED=$(git diff src/locales/percentages.json)
|
|
|
|
if [ ! -z "${FILE_CHANGED}" ]; then
|
2021-01-22 17:06:21 +01:00
|
|
|
git config --global user.name 'Excalidraw Bot'
|
|
|
|
git config --global user.email 'bot@excalidraw.com'
|
2020-06-30 20:28:19 +02:00
|
|
|
git add src/locales/percentages.json
|
|
|
|
git commit -am "Auto commit: Calculate translation coverage"
|
|
|
|
git push
|
|
|
|
fi
|
2020-12-19 14:52:50 +01:00
|
|
|
- name: Construct comment body
|
|
|
|
id: getCommentBody
|
|
|
|
run: |
|
2020-12-19 21:44:01 +01:00
|
|
|
body=$(npm run locales-coverage:description | grep '^[^>]')
|
|
|
|
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 14:52:50 +01:00
|
|
|
with:
|
2020-12-19 21:44:01 +01:00
|
|
|
pr_body: ${{ steps.getCommentBody.outputs.body }}
|
2021-01-14 11:09:05 +01:00
|
|
|
pr_title: "chore: Update translations from Crowdin"
|
2020-12-19 21:44:01 +01:00
|
|
|
github_token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|