Skip to content

Commit ea101a4

Browse files
committed
fix(ci): add --repo flag to localization reminder workflow..maybe
1 parent 1235748 commit ea101a4

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Notify Localization Team
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
paths:
7+
- '**/*.i18n.ts'
8+
9+
jobs:
10+
remind-localization-ticket:
11+
name: Remind to create localization ticket
12+
runs-on: ubuntu-latest
13+
if: github.event.pull_request.user.login != 'transifex-integration[bot]'
14+
15+
steps:
16+
- name: Post localization reminder
17+
run: |
18+
EXISTING=$(gh pr view "${{ github.event.pull_request.number }}" \
19+
--repo "${{ github.repository }}" \
20+
--json comments \
21+
--jq '[.comments[] | select(.body | contains("localization ticket"))] | length')
22+
23+
if [ "$EXISTING" -gt 0 ]; then
24+
echo "Reminder already posted, skipping."
25+
exit 0
26+
fi
27+
28+
gh pr comment "${{ github.event.pull_request.number }}" \
29+
--repo "${{ github.repository }}" \
30+
--body "$(cat <<'EOF'
31+
**Localization reminder:** This PR adds or modifies \`.i18n.ts\` files.
32+
33+
Please create a Jira ticket for the localization manager to initiate translation of any new or updated strings in Transifex. See [LOC-1766](https://commercetools.atlassian.net/browse/LOC-1766) as an example.
34+
EOF
35+
)"
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)