-
Notifications
You must be signed in to change notification settings - Fork 23
63 lines (57 loc) · 1.82 KB
/
i18n-missing-keys.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: i18n Missing Keys
on:
push:
branches:
- development
jobs:
detect:
name: Detect
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '18'
cache: 'yarn'
- run: yarn install
# Run linter and store output.
- name: Lint
id: lint
run: |
output="$(yarn i18n lint-missing-keys)"
echo "LINT_OUTPUT<<EOF" >> $GITHUB_ENV
echo "$output" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# Attempt to find existing comment.
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: 778
comment-author: 'github-actions[bot]'
body-includes: 'Auto-generated Missing i18n Keys'
# Create comment if does not exist.
- name: Create comment
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: 778
body: |
# :yin_yang: Auto-generated Missing i18n Keys :yin_yang:
Updated at ${{ github.event.head_commit.timestamp }} (HEAD -> ${{ github.event.head_commit.id }})
```diff
${{ env.LINT_OUTPUT }}
```
# Update comment if exists.
- name: Update comment
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v2
with:
edit-mode: replace
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
# :yin_yang: Auto-generated Missing i18n Keys :yin_yang:
Updated at ${{ github.event.head_commit.timestamp }} (HEAD -> ${{ github.event.head_commit.id }})
```diff
${{ env.LINT_OUTPUT }}
```