-
Notifications
You must be signed in to change notification settings - Fork 363
44 lines (41 loc) · 1.64 KB
/
tx-pull.yml
File metadata and controls
44 lines (41 loc) · 1.64 KB
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
on:
workflow_dispatch:
schedule:
# every day at 8:15 PM UTC
- cron: "15 20 * * *"
name: "Scheduled Transifex Update"
jobs:
pull-translations-from-transifex:
name: pull-translations-from-transifex
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.repository_owner == 'openmrs'
steps:
- uses: actions/checkout@v4
- name: Pull source files using transifex client
uses: transifex/cli-action@v2
with:
token: ${{ secrets.TRANSIFEX_TOKEN }}
args: pull --force --all
- name: Create PR if necessary
id: cpr
uses: peter-evans/create-pull-request@v7
with:
commit-message: '(chore) Update translations from Transifex'
title: '(chore) Update translations from Transifex'
body: 'Automated updates of translations pulled from Transifex'
branch: 'chore/update-transifex'
author: 'OpenMRS Bot <infrastructure@openmrs.org>'
token: ${{ secrets.OMRS_BOT_GH_TOKEN }}
- name: ✅ Auto approve PR
if: steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated'
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🔀 Automerge PR
if: steps.cpr.outputs.pull-request-operation == 'created' || steps.cpr.outputs.pull-request-operation == 'updated'
run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.OMRS_BOT_GH_TOKEN }}