File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,27 +88,21 @@ jobs:
8888 cd ./tools/localization
8989 yarn start update
9090
91- - name : Commit changes
92- run : |
93- git add docs/marketing/localized_description AnkiDroid/src/main/res
94- git commit -am 'Updated strings from Crowdin'
95- git push --set-upstream origin +i18n_sync
96- echo "The results of the sync are on the i18n_sync branch, PR them from there for merge."
97- echo "https://github.com/ankidroid/Anki-Android/compare/i18n_sync?expand=1"
98-
99- - name : Check if there are strings changes
91+ - name : Check for changes and handle results
10092 id : tr_check
10193 run : |
102- git checkout i18n_sync
103- COMMITS_COUNT=`git rev-list --count HEAD ^main`
104- if [ "$COMMITS_COUNT" -gt 0 ]; then
105- echo "HAS_CHANGES=true" >> $GITHUB_OUTPUT
106- else
94+ git add docs/marketing/localized_description AnkiDroid/src/main/res
95+ if git diff --cached --quiet; then
10796 echo "HAS_CHANGES=false" >> $GITHUB_OUTPUT
97+ echo "Translation Sync Result: No new translation found on Crowdin. No Pull Request necessary" >> $GITHUB_STEP_SUMMARY
98+ else
99+ echo "HAS_CHANGES=true" >> $GITHUB_OUTPUT
100+ git commit -m 'Updated strings from Crowdin'
101+ git push --set-upstream origin +i18n_sync
108102 fi
109103
110104 - name : Create PR for strings changes if needed
111- if : ${{ steps.tr_check.outputs.HAS_CHANGES }}
105+ if : steps.tr_check.outputs.HAS_CHANGES == 'true'
112106 uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
113107 with :
114108 github-token : ${{ secrets.MACHINE_ACCOUNT_PAT }}
You can’t perform that action at this time.
0 commit comments