2024-04-09 00:33:58 +02:00
|
|
|
name: Sync Files
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- "build.gradle"
|
|
|
|
- "src/main/resources/messages_*.properties"
|
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
|
|
|
|
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
|
|
|
|
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
|
|
|
|
uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1
|
|
|
|
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
|
2024-12-21 13:28:35 +01:00
|
|
|
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.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: |
|
|
|
|
git add .
|
|
|
|
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
|
|
|
|
2024-04-09 00:33:58 +02:00
|
|
|
- name: Sync README
|
|
|
|
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: |
|
|
|
|
git add .
|
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-01-19 00:01:16 +01:00
|
|
|
title: ":memo: Sync translation files + Update README.md (Translation Progress Table)"
|
2024-04-09 00:33:58 +02:00
|
|
|
body: |
|
2025-01-19 00:01:16 +01:00
|
|
|
#### Description
|
|
|
|
|
|
|
|
This Pull Request was automatically generated to synchronize updates to translation files and documentation. The changes include:
|
|
|
|
|
|
|
|
1. **Synchronization of Translation Files:**
|
|
|
|
- Updated content based on the latest changes in `messages_en_GB.properties`.
|
|
|
|
- Ensured consistency between all language files and the reference file.
|
|
|
|
|
|
|
|
2. **Update README.md:**
|
|
|
|
- Generated the translation progress table.
|
|
|
|
- Displayed the current status of translations for all supported languages.
|
|
|
|
|
|
|
|
---
|
2024-04-09 00:33:58 +02:00
|
|
|
Auto-generated by [create-pull-request][1]
|
|
|
|
|
|
|
|
[1]: https://github.com/peter-evans/create-pull-request
|
|
|
|
draft: false
|
|
|
|
delete-branch: true
|
2024-07-22 22:15:10 +02:00
|
|
|
labels: Documentation,Translation,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
|