update #5
2 changed files with 29 additions and 22 deletions
16
.github/scripts/check_language_properties.py
vendored
16
.github/scripts/check_language_properties.py
vendored
|
@ -165,6 +165,7 @@ def check_for_differences(reference_file, file_list, branch):
|
|||
report.append(
|
||||
f" - **Issue:** Too many lines! Check your translation files! Details: {reference_line_count} (reference) vs {current_line_count} (current)."
|
||||
)
|
||||
# update_missing_keys(reference_file, [file_path], branch + "/")
|
||||
else:
|
||||
report.append("- **Test 1 Status:** ✅ Passed")
|
||||
|
||||
|
@ -200,16 +201,19 @@ def check_for_differences(reference_file, file_list, branch):
|
|||
report.append(
|
||||
f" - **Issue:** There are keys in ***{basename_reference_file}*** `{extra_keys_str}` that are not present in ***{basename_current_file}***!"
|
||||
)
|
||||
# update_missing_keys(reference_file, [file_path], branch + "/")
|
||||
else:
|
||||
report.append("- **Test 2 Status:** ✅ Passed")
|
||||
if has_differences:
|
||||
report.append("")
|
||||
report.append(f"#### 🚧 ***{basename_current_file}*** will be corrected...")
|
||||
report.append("")
|
||||
# if has_differences:
|
||||
# report.append("")
|
||||
# report.append(f"#### 🚧 ***{basename_current_file}*** will be corrected...")
|
||||
report.append("")
|
||||
report.append("---")
|
||||
report.append("")
|
||||
update_file_list = glob.glob(branch + "/src/**/messages_*.properties", recursive=True)
|
||||
update_missing_keys(reference_file, update_file_list)
|
||||
# update_file_list = glob.glob(branch + "/src/**/messages_*.properties", recursive=True)
|
||||
# update_missing_keys(reference_file, update_file_list)
|
||||
# report.append("---")
|
||||
# report.append("")
|
||||
if has_differences:
|
||||
report.append("## ❌ Overall Check Status: **_Failed_**")
|
||||
else:
|
||||
|
|
35
.github/workflows/check_properties.yml
vendored
35
.github/workflows/check_properties.yml
vendored
|
@ -21,7 +21,8 @@ jobs:
|
|||
- name: Checkout PR branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
path: pr-branch
|
||||
fetch-depth: 0
|
||||
|
||||
|
@ -47,6 +48,7 @@ jobs:
|
|||
run: |
|
||||
echo "Fetching PR changed files..."
|
||||
cd pr-branch
|
||||
gh repo set-default ${{ github.repository }}
|
||||
gh pr view ${{ github.event.pull_request.number }} --json files -q ".files[].path" > ../changed_files.txt
|
||||
cd ..
|
||||
echo $(cat changed_files.txt)
|
||||
|
@ -134,22 +136,23 @@ jobs:
|
|||
console.log("Comment update attempt denied. Actor does not match.");
|
||||
}
|
||||
|
||||
- name: Set up git config
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
# - name: Set up git config
|
||||
# run: |
|
||||
# git config --global user.name "github-actions[bot]"
|
||||
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Add translation keys
|
||||
run: |
|
||||
cd ${{ env.BRANCH_PATH }}
|
||||
git add src/main/resources/messages_*.properties
|
||||
git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
|
||||
git commit -m "Update translation files" || echo "No changes to commit"
|
||||
- name: Push
|
||||
if: env.CHANGES_DETECTED == 'true'
|
||||
run: |
|
||||
cd pr-branch
|
||||
git push origin ${{ github.head_ref }} || echo "Push failed: possibly no changes to push"
|
||||
# - name: Add translation keys
|
||||
# run: |
|
||||
# cd ${{ env.BRANCH_PATH }}
|
||||
# git add src/main/resources/messages_*.properties
|
||||
# git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
|
||||
# git commit -m "Update translation files" || echo "No changes to commit"
|
||||
# - name: Push
|
||||
# if: env.CHANGES_DETECTED == 'true'
|
||||
# run: |
|
||||
# cd pr-branch
|
||||
# git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git
|
||||
# git push origin ${{ github.head_ref }} || echo "Push failed: possibly no changes to push"
|
||||
|
||||
update-translations-main:
|
||||
if: github.event_name == 'push'
|
||||
|
|
Loading…
Reference in a new issue