@@ -45,21 +45,31 @@ jobs:
45
45
- name : Update Language Files
46
46
if : steps.dry_run_lang.outputs.lang_updated == 'true'
47
47
run : |
48
- UPDATE_LANG_OUTPUT=$(python scripts/update_lang.py --max_files 1 --model mistral | grep "Total Markdown files to process:")
49
- echo "$UPDATE_LANG_OUTPUT"
50
- if [[ "$UPDATE_LANG_OUTPUT" == *'Total Markdown files to process: 0'* ]]; then
48
+ TOTAL_POSTS=$(python scripts/update_lang.py --dry_run | grep "Total Markdown files to process:" | awk '{print $NF}')
49
+ echo "Total posts to process: $TOTAL_POSTS"
50
+
51
+ if [[ "$TOTAL_POSTS" -eq 0 ]]; then
51
52
echo "No language files to update."
52
53
else
53
- git config user.name "github-actions[bot]"
54
- git config user.email "github-actions[bot]@users.noreply.github.com"
55
- git add _posts/**/*.md
56
- git diff --cached --quiet || git commit -m "chore(lang): Update language files"
57
-
58
- git push || {
59
- echo "Push failed, attempting pull and merge"
60
- git pull --rebase
61
- git push
62
- }
54
+ for i in $(seq 1 "$TOTAL_POSTS"); do
55
+ UPDATE_LANG_OUTPUT=$(python scripts/update_lang.py --max_files 1 --model mistral | grep "Total Markdown files to process:")
56
+ echo "$UPDATE_LANG_OUTPUT"
57
+ if [[ "$UPDATE_LANG_OUTPUT" == *'Total Markdown files to process: 0'* ]]; then
58
+ echo "No more language files to update."
59
+ break
60
+ else
61
+ git config user.name "github-actions[bot]"
62
+ git config user.email "github-actions[bot]@users.noreply.github.com"
63
+ git add _posts/**/*.md
64
+ git diff --cached --quiet || git commit -m "chore(lang): Update language files"
65
+
66
+ git push || {
67
+ echo "Push failed, attempting pull and merge"
68
+ git pull --rebase
69
+ git push
70
+ }
71
+ fi
72
+ done
63
73
fi
64
74
env :
65
75
DEEPSEEK_API_KEY : ${{ secrets.DEEPSEEK_API_KEY }}
69
79
id : dry_run_pdf
70
80
run : |
71
81
DRY_RUN_PDF_OUTPUT=$(python scripts/update_pdf.py --max_files 1000 --dry_run)
72
- echo "$DRY_RUN_PDF_OUTPUT"
82
+ echo "$DRY_RUN_PDF_OUTPUT"
73
83
74
84
if [[ "$DRY_RUN_PDF_OUTPUT" == *'Total Markdown files to process: 0'* ]]; then
75
85
echo "pdf_updated=false" >> "$GITHUB_OUTPUT"
0 commit comments