ci: Better locale coverage comment (#2616)

Co-authored-by: kbariotis <konmpar@gmail.com>
This commit is contained in:
Lipis 2020-12-19 20:35:03 +02:00 committed by GitHub
parent 4ff8f3b006
commit d3bebbc68d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 173 additions and 16 deletions

View file

@ -49,22 +49,7 @@ jobs:
- name: Construct comment body
id: getCommentBody
run: |
locales_above_threshold=$(cat src/locales/percentages.json | jq -r 'to_entries[] | select(.value > 85) | "|\(.key)|\(.value)|"')
locales_below_threshold=$(cat src/locales/percentages.json | jq -r 'to_entries[] | select(.value <= 85) | "|\(.key)|\(.value)|"')
header=$(echo "
## Languages check
Our translations for every languages should be at least **85%** to appear on Excalidraw. Help us translate them in [Crowdin](https://crowdin.com/project/excalidraw).
")
comment_body=$(echo "$header
### Languages over the threshold
|Locale|%|
|----|----|
$locales_above_threshold
### Languages below the threshold
|Locale|%|
|----|----|
$locales_below_threshold
")
body=$(npm run locales-coverage:comment)
comment_body="${comment_body//'%'/'%25'}"
comment_body="${comment_body//$'\n'/'%0A'}"
comment_body="${comment_body//$'\r'/'%0D'}"