mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
ci: Update the coverage report for i18n PRs (#2592)
Co-authored-by: Kostas Bariotis <konmpar@gmail.com>
This commit is contained in:
parent
d3bebbc68d
commit
5d6590c200
8 changed files with 54 additions and 95 deletions
46
.github/workflows/locales-coverage.yml
vendored
46
.github/workflows/locales-coverage.yml
vendored
|
@ -30,44 +30,18 @@ jobs:
|
|||
git commit -am "Auto commit: Calculate translation coverage"
|
||||
git push
|
||||
fi
|
||||
|
||||
- name: Find pull request number
|
||||
uses: jwalton/gh-find-current-pr@v1
|
||||
id: findPullRequestNumber
|
||||
with:
|
||||
github-token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
||||
|
||||
- name: Find Comment
|
||||
uses: peter-evans/find-comment@v1
|
||||
id: findComment
|
||||
with:
|
||||
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
||||
issue-number: ${{ steps.findPullRequestNumber.outputs.pr }}
|
||||
comment-author: "kbariotis"
|
||||
body-includes: "Languages check"
|
||||
|
||||
- name: Construct comment body
|
||||
id: getCommentBody
|
||||
run: |
|
||||
body=$(npm run locales-coverage:comment)
|
||||
comment_body="${comment_body//'%'/'%25'}"
|
||||
comment_body="${comment_body//$'\n'/'%0A'}"
|
||||
comment_body="${comment_body//$'\r'/'%0D'}"
|
||||
echo ::set-output name=body::$comment_body
|
||||
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: Create comment
|
||||
if: ${{ steps.findComment.outputs.comment-id == 0 }}
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
- name: Update description with coverage
|
||||
uses: kt3k/update-pr-description@v1.0.1
|
||||
with:
|
||||
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
||||
issue-number: ${{ steps.findPullRequestNumber.outputs.pr }}
|
||||
body: ${{ steps.getCommentBody.outputs.body }}
|
||||
|
||||
- name: Update comment
|
||||
if: ${{ steps.findComment.outputs.comment-id != 0 }}
|
||||
uses: peter-evans/create-or-update-comment@v1
|
||||
with:
|
||||
edit-mode: "replace"
|
||||
token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
||||
comment-id: ${{ steps.findComment.outputs.comment-id }}
|
||||
body: ${{ steps.getCommentBody.outputs.body }}
|
||||
pr_body: ${{ steps.getCommentBody.outputs.body }}
|
||||
pr_title: "chore: New Crowdin updates"
|
||||
github_token: ${{ secrets.PUSH_TRANSLATIONS_COVERAGE_PAT }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue