Create upstream pull requests #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v2 | |
with: | |
path: translations | |
ref: ${{ matrix.component }} | |
- name: Check out upstream ${{ matrix.component }} repository | |
uses: actions/checkout@v2 | |
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 '::set-output name=create-pr::1' | |
- name: Create pull request in upstream repository | |
if: ${{ steps.update-translations.outputs.create-pr }} | |
uses: peter-evans/create-pull-request@v3 | |
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 }} |