Skip to content

Changelog test (bsc#1231235) #40

Changelog test (bsc#1231235)

Changelog test (bsc#1231235) #40

name: Check if translation is required
on:
pull_request_target:
paths:
- 'java/code/src/com/redhat/rhn/frontend/strings/**'
- 'backend/**'
- 'client/rhel/yum-rhn-plugin/**'
- 'client/rhel/mgr-daemon/**'
- 'client/rhel/spacewalk-client-tools/**'
- 'web/**'
- 'susemanager/**'
- 'spacecmd/**'
jobs:
run:
name: Check by trying to locally update translation files
if: github.repository == 'uyuni-project/uyuni'
runs-on: ubuntu-latest
steps:
- name: Setup tooling
run: sudo apt-get install -y make git gettext intltool python3
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- name: Setup git
run: |
git config --global user.name "Galaxy CI"
git config --global user.email "galaxy-ci@suse.de"
- name: Checkout repo
uses: actions/checkout@v4
with:
path: 'master_repo'
- name: Update all translations files
run: |
cd master_repo
git switch -c check_translations
git branch origin_check_translations
ADDITIONAL_SAFE_BRANCHNAME=check_translations scripts/translation/update-all-translation-strings.sh
cd ..
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if there has been changes on translation files for master
run: |
cd master_repo
trs=$(git diff origin_check_translations check_translations | wc -l)
echo "Translations needed for master: ${trs}"
echo "translations_needed_for_master=${trs}" >> $GITHUB_ENV
cd ..
- name: Checkout PR repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: 'pr_repo'
- name: Update all translations files for PR
run: |
cd pr_repo
git switch -c check_translations
git branch origin_check_translations
ADDITIONAL_SAFE_BRANCHNAME=check_translations scripts/translation/update-all-translation-strings.sh
cd ..
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if there has been changes on translation files
run: |
cd pr_repo
trs=$(git diff origin_check_translations check_translations | wc -l)
echo "Translations needed for PR: ${trs}"
echo "translations_needed_for_PR=${trs}" >> $GITHUB_ENV
cd ..
- name: Add label
if: env.translations_needed_for_master != env.translations_needed_for_PR
uses: andymckay/labeler@1.0.4
with:
add-labels: "needs-translation"
repo-token: "${{ secrets.GITHUB_TOKEN }}"