2024-04-09 00:33:58 +02:00
name : Sync Files
on :
2025-01-25 15:06:45 +01:00
workflow_dispatch :
2024-04-09 00:33:58 +02:00
push :
branches :
- main
paths :
- "build.gradle"
2025-01-25 15:06:45 +01:00
- "README.md"
2024-04-09 00:33:58 +02:00
- "src/main/resources/messages_*.properties"
2025-01-25 15:06:45 +01:00
- "src/main/resources/static/3rdPartyLicenses.json"
2024-06-26 22:47:20 +02:00
- "scripts/ignore_translation.toml"
2024-04-09 00:33:58 +02:00
2025-01-02 19:22:14 +01:00
permissions :
contents : read
2024-04-09 00:33:58 +02:00
jobs :
2025-01-19 00:01:16 +01:00
read_bot_entries :
2024-04-09 00:33:58 +02:00
runs-on : ubuntu-latest
2025-01-19 00:01:16 +01:00
outputs :
userName : ${{ steps.get-user-id.outputs.user_name }}
userEmail : ${{ steps.get-user-id.outputs.user_email }}
committer : ${{ steps.committer.outputs.committer }}
2024-04-09 00:33:58 +02:00
steps :
2024-12-21 13:28:35 +01:00
- name : Harden Runner
2025-01-21 12:11:01 +01:00
uses : step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
2024-12-21 13:28:35 +01:00
with :
egress-policy : audit
2025-01-19 00:01:16 +01:00
- name : Generate GitHub App Token
id : generate-token
2025-02-03 11:07:37 +01:00
uses : actions/create-github-app-token@136412a57a7081aa63c935a2cc2918f76c34f514 # v1.11.2
2025-01-19 00:01:16 +01:00
with :
app-id : ${{ secrets.GH_APP_ID }}
private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
- name : Get GitHub App User ID
id : get-user-id
run : |
USER_NAME="${{ steps.generate-token.outputs.app-slug }}[bot]"
USER_ID=$(gh api "/users/$USER_NAME" --jq .id)
USER_EMAIL="$USER_ID+$USER_NAME@users.noreply.github.com"
echo "user_name=$USER_NAME" >> "$GITHUB_OUTPUT"
echo "user_email=$USER_EMAIL" >> "$GITHUB_OUTPUT"
echo "user-id=$USER_ID" >> "$GITHUB_OUTPUT"
env :
GH_TOKEN : ${{ steps.generate-token.outputs.token }}
- id : committer
run : |
COMMITTER="${{ steps.get-user-id.outputs.user_name }} <${{ steps.get-user-id.outputs.user_email }}>"
echo "committer=$COMMITTER" >> "$GITHUB_OUTPUT"
sync-files :
needs : [ "read_bot_entries" ]
runs-on : ubuntu-latest
steps :
- name : Harden Runner
2025-01-21 12:11:01 +01:00
uses : step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
2025-01-19 00:01:16 +01:00
with :
egress-policy : audit
- name : Generate GitHub App Token
id : generate-token
2025-02-03 11:07:37 +01:00
uses : actions/create-github-app-token@136412a57a7081aa63c935a2cc2918f76c34f514 # v1.11.2
2025-01-19 00:01:16 +01:00
with :
app-id : ${{ vars.GH_APP_ID }}
private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
2024-12-21 13:28:35 +01:00
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2025-01-19 00:01:16 +01:00
2024-04-09 00:33:58 +02:00
- name : Set up Python
2025-02-03 11:09:15 +01:00
uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
2024-04-09 00:33:58 +02:00
with :
2025-01-08 16:33:35 +01:00
python-version : "3.12"
2025-01-16 23:04:38 +01:00
cache : 'pip' # caching pip dependencies
2025-01-19 00:01:16 +01:00
- name : Sync translation property files
run : |
python .github/scripts/check_language_properties.py --reference-file "src/main/resources/messages_en_GB.properties" --branch main
- name : Set up git config
run : |
git config --global user.name ${{ needs.read_bot_entries.outputs.userName }}
git config --global user.email ${{ needs.read_bot_entries.outputs.userEmail }}
- name : Run git add
run : |
2025-01-25 15:06:45 +01:00
git add src/main/resources/messages_*.properties
2025-01-19 00:01:16 +01:00
git diff --staged --quiet || git commit -m ":memo: Sync translation files" || echo "no changes"
2024-04-28 00:26:12 +02:00
- name : Install dependencies
2025-01-10 12:25:23 +01:00
run : pip install --require-hashes -r ./.github/scripts/requirements_sync_readme.txt
2025-01-19 00:01:16 +01:00
2025-01-25 15:06:45 +01:00
- name : Sync README.md
2024-04-09 00:33:58 +02:00
run : |
2025-01-19 00:01:16 +01:00
python scripts/counter_translation.py
2024-04-09 00:33:58 +02:00
- name : Run git add
run : |
2025-01-25 15:06:45 +01:00
git add README.md
2025-01-19 00:01:16 +01:00
git diff --staged --quiet || git commit -m ":memo: Sync README.md" || echo "no changes"
2024-04-09 00:33:58 +02:00
- name : Create Pull Request
2025-01-02 15:24:04 +01:00
uses : peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
2024-04-09 00:33:58 +02:00
with :
2025-01-19 00:01:16 +01:00
token : ${{ steps.generate-token.outputs.token }}
2024-04-09 00:33:58 +02:00
commit-message : Update files
2025-01-19 00:01:16 +01:00
committer : ${{ needs.read_bot_entries.outputs.committer }}
author : ${{ needs.read_bot_entries.outputs.committer }}
2024-04-09 00:33:58 +02:00
signoff : true
branch : sync_readme
2025-02-04 21:58:06 +01:00
title : ":globe_with_meridians: Sync Translations + Update README Progress Table"
2024-04-09 00:33:58 +02:00
body : |
2025-01-25 15:06:45 +01:00
### Description of Changes
2025-02-04 21:58:06 +01:00
This Pull Request was automatically generated to synchronize updates to translation files and documentation. Below are the details of the changes made :
2025-01-19 00:01:16 +01:00
2025-01-25 15:06:45 +01:00
#### **1. Synchronization of Translation Files**
- Updated translation files (`messages_*.properties`) to reflect changes in the reference file `messages_en_GB.properties`.
- Ensured consistency and synchronization across all supported language files.
- Highlighted any missing or incomplete translations.
2025-01-19 00:01:16 +01:00
2025-01-25 15:06:45 +01:00
#### **2. Update README.md**
- Generated the translation progress table in `README.md`.
- Added a summary of the current translation status for all supported languages.
- Included up-to-date statistics on translation coverage.
2025-01-19 00:01:16 +01:00
2025-01-25 15:06:45 +01:00
#### **Why these changes are necessary**
- Keeps translation files aligned with the latest reference updates.
- Ensures the documentation reflects the current translation progress.
2025-01-19 00:01:16 +01:00
---
2025-01-25 15:06:45 +01:00
Auto-generated by [create-pull-request][1].
2024-04-09 00:33:58 +02:00
[1] : https://github.com/peter-evans/create-pull-request
draft : false
delete-branch : true
2025-01-25 15:06:45 +01:00
labels : github-actions
2024-12-22 01:41:45 +01:00
sign-commits : true
2025-01-19 00:01:16 +01:00
add-paths : |
README.md
src/main/resources/messages_*.properties