Update translations #5
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
# ====================================== | |
# WARNING! | |
# THIS FILE IS GENERATED FROM A TEMPLATE | |
# DO NOT EDIT THIS FILE MANUALLY! | |
# ====================================== | |
# The template is located in: l10n-po-update.yml.j2 | |
name: Update translations | |
on: | |
# Runs weekly every Monday at 5 AM, so it can be used before automatic build on Tuesday | |
schedule: | |
- cron: '0 5 * * 1' | |
# can be run manually on https://github.com/rhinstaller/anaconda/actions | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'schedule' || github.repository == 'rhinstaller/anaconda' | |
environment: releases | |
permissions: | |
contents: write | |
pull-requests: write | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
branch: ['master'] | |
steps: | |
- name: Set up dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y make git | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
with: | |
repository: rhinstaller/anaconda | |
ref: ${{ matrix.branch }} | |
token: ${{ secrets.INSTALLKER_TOKEN }} | |
- name: Set up git configuration | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- name: Bump the SHA | |
id: bump_sha | |
run: | | |
make -f Makefile.am bump-l10n-sha | |
if [ -n "$(git status -s po/l10n-config.mk)" ] ; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Make a branch with commit | |
id: make_branch | |
if: steps.bump_sha.outputs.changed == 'true' | |
run: | | |
git commit po/l10n-config.mk -m "Update translations from Weblate for ${{ matrix.branch }}" | |
branch_name="l10n-update/${{ matrix.branch }}-$(date '+%Y-%M-%d--%H-%M-%S')" | |
git checkout -b "$branch_name" | |
git push origin "$branch_name" | |
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | |
- name: Make pull request | |
if: steps.bump_sha.outputs.changed == 'true' | |
env: | |
GITHUB_TOKEN: ${{ secrets.INSTALLKER_TOKEN }} | |
run: | | |
# https://cli.github.com/manual/gh_pr_create | |
gh pr create \ | |
--base ${{ matrix.branch }} \ | |
--head ${{ steps.make_branch.outputs.branch_name }} \ | |
--title 'Update translations from Weblate' \ | |
--body 'Created by Github actions' \ | |
--label 'sanity check required' |