-
Notifications
You must be signed in to change notification settings - Fork 26
87 lines (83 loc) · 3.45 KB
/
automated-translations.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Developers commit changes to the LTS branch. This workflow keeps the `automated-translations` branch up to date
# with the LTS branch.
#
# Lingoport will watch the automated-translations branch and automatically translate the resources_en_US.json
# files to the target languages. The translated files will be committed back to the automated-translations branch.
#
# When the `automated-translations` branch has changes to merge back, this workflow creates a pull request.
#
# When the `automated-translations` branch is merged and deleted, this workflow recreates the branch.
name: Automated Translations 11.x.x
on:
push:
branches:
- 11.x.x
- automated-translations
workflow_dispatch:
env:
LTS_BRANCH: '11.x.x'
jobs:
automated-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: '${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}'
- uses: actions/setup-node@v4
id: setup-node
with:
node-version-file: '.nvmrc'
- name: Ensure cache directory exists
run: mkdir -p /home/runner/.npm
continue-on-error: true
- name: Sync Translation Branch
id: sync
run: |
./scripts/automated-translations.ps1 \
-LtsBranchName $LTS_BRANCH \
-TempPath ${{ runner.temp }}
env:
GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
GH_PROMPT_DISABLED: 1
- name: Notify Slack when a PR is created
if: ${{ steps.sync.outputs.prCreated == 'true' && steps.sync.outputs.prTitle && steps.sync.outputs.prUrl }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: ':writing_hand: `automated-translations` PR created: ${{ steps.sync.outputs.prTitle }}'
SLACK_MESSAGE: '${{ steps.sync.outputs.prUrl }}'
SLACK_ICON_EMOJI: ':github:'
SLACK_USERNAME: GitHub
#cor-skyux-notifications
SLACK_CHANNEL: C01GY7ZP4HM
SLACK_COLOR: ${{ job.status }}
SLACK_FOOTER: 'Blackbaud Sky Build User'
MSG_MINIMAL: 'true'
- name: Notify Slack when a PR is updated
if: ${{ steps.sync.outputs.prCreated == 'false' && steps.sync.outputs.prTitle && steps.sync.outputs.prUrl }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: ':writing_hand: `automated-translations` PR updated: ${{ steps.sync.outputs.prTitle }}'
SLACK_MESSAGE: '${{ steps.sync.outputs.prUrl }}'
SLACK_ICON_EMOJI: ':github:'
SLACK_USERNAME: GitHub
#cor-skyux-notifications
SLACK_CHANNEL: C01GY7ZP4HM
SLACK_COLOR: ${{ job.status }}
SLACK_FOOTER: 'Blackbaud Sky Build User'
MSG_MINIMAL: 'true'
- name: Notify Slack for fails
if: ${{ failure() || steps.sync.outputs.success != 'true' }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: ':writing_hand: :x: `automated-translations` sync failed'
SLACK_MESSAGE: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
SLACK_ICON_EMOJI: ':github:'
SLACK_USERNAME: GitHub
#cor-skyux-notifications
SLACK_CHANNEL: C01GY7ZP4HM
SLACK_COLOR: 'fail'
SLACK_FOOTER: 'Blackbaud Sky Build User'
MSG_MINIMAL: 'true'