-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (54 loc) · 1.84 KB
/
upstream-pr.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
name: Create upstream pull requests
on:
schedule:
# At 6:00 AM on the fifth of every month.
- cron: '0 6 5 * *'
# Allow triggering the workflow manually.
workflow_dispatch:
jobs:
pr:
runs-on: ubuntu-latest
strategy:
matrix:
component:
- abrt
- gnome-abrt
- libreport
- retrace-server
steps:
- name: Check out ${{ matrix.component }} translations
uses: actions/checkout@v4
with:
path: translations
ref: ${{ matrix.component }}
- name: Check out upstream ${{ matrix.component }} repository
uses: actions/checkout@v4
with:
path: upstream
repository: abrt/${{ matrix.component }}
token: ${{ secrets.ABRT_BOT_TOKEN }}
- name: Update translation files
id: update-translations
run: |
cp --verbose --preserve=all translations/* upstream/po/
# Fail if no files were changed.
[[ -z $(git -C upstream status --porcelain) ]] && \
echo 'No translation files changed' && \
exit 0
echo 'Translation files updated'
echo 'create-pr=1' >> $GITHUB_OUTPUT
- name: Create pull request in upstream repository
if: ${{ steps.update-translations.outputs.create-pr }}
uses: peter-evans/create-pull-request@v5
with:
branch: translations-update
path: upstream/
delete-branch: true
commit-message: Update translations
committer: 'abrt-bot <[email protected]>'
title: Update translations
body: >
Updating translations from Weblate contributors from the
[localization repository](https://github.com/abrt/l10n).
labels: localization
token: ${{ secrets.ABRT_BOT_TOKEN }}