c08be69618
* docker: use slim alpine image to remove bundling deps in Docker image * pin remaining yml actions * use lockfile * remove pulling
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
name: Build locales coverage
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- l10n_master
|
|
|
|
jobs:
|
|
locales:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
with:
|
|
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
|
with:
|
|
node-version: 20.x
|
|
|
|
- name: Create report file
|
|
run: |
|
|
yarn locales-coverage
|
|
FILE_CHANGED=$(git diff packages/excalidraw/locales/percentages.json)
|
|
if [ ! -z "${FILE_CHANGED}" ]; then
|
|
git config --global user.name 'Excalidraw Bot'
|
|
git config --global user.email 'bot@excalidraw.com'
|
|
git add packages/excalidraw/locales/percentages.json
|
|
git commit -am "Auto commit: Calculate translation coverage"
|
|
git push
|
|
fi
|
|
- name: Construct comment body
|
|
id: getCommentBody
|
|
run: |
|
|
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@1b35a6dcd84d81aa0bc1889610efdcde7f37b0c0 # v1.0.1
|
|
with:
|
|
pr_body: ${{ steps.getCommentBody.outputs.body }}
|
|
pr_title: "chore: Update translations from Crowdin"
|
|
github_token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|